在解析包含日期(例如 13/Nov/11)的 Jira 自定义字段时,我从以下内容开始:
elsif custom.customfieldId == "customfield_10282"
@agenda_item.planned_release_date = custom.values.to_s
但数据库将其存储为 11/13/0011。所以我变得聪明并使用了这个:
elsif custom.customfieldId == "customfield_10282"
@agenda_item.planned_release_date = Date.strptime(custom.values, "%d/%m/%Y")
现在我得到:
私有方法sub!' called for ["15/Nov/11"]:Jira4R::V2::ArrayOf_xsd_string
C:/Ruby187/lib/ruby/1.8/date/format.rb:429:in
_strptime_i' C:/Ruby187/lib/ruby/1.8/date/format.rb:401:in scan'
C:/Ruby187/lib/ruby/1.8/date/format.rb:401:in
_strptime_i' C:/Ruby187/lib/ruby/1.8/date/format.rb:601:in `_strptime' [截断堆栈的其余部分]
我错过了什么?