When parsing a Jira Custom Field containing a date (e.g. 13/Nov/11) I started with this:
elsif custom.customfieldId == "customfield_10282"
@agenda_item.planned_release_date = custom.values.to_s
But the database stores it as 11/13/0011. So I got clever and used this:
elsif custom.customfieldId == "customfield_10282"
@agenda_item.planned_release_date = Date.strptime(custom.values, "%d/%m/%Y")
And now I get:
private method sub!' called for ["15/Nov/11"]:Jira4R::V2::ArrayOf_xsd_string_strptime_i’
C:/Ruby187/lib/ruby/1.8/date/format.rb:429:in
C:/Ruby187/lib/ruby/1.8/date/format.rb:401:in scan'_strptime_i’
C:/Ruby187/lib/ruby/1.8/date/format.rb:401:in
C:/Ruby187/lib/ruby/1.8/date/format.rb:601:in `_strptime’
[truncated the rest of the stack]
What am I missing?
This works:
Your problems:
`%Yis the year with 4 digits (2011). Use%y%mis the month in digits (11). Use%binstead (Nov)