mysterioustrousers / MTDates

A thread safe date calculation library with all the date functions you'll ever need.
BSD 2-Clause "Simplified" License
343 stars 68 forks source link

Fix mt_dateFromISOString #55

Open hayashi311 opened 9 years ago

hayashi311 commented 9 years ago

When [NSLocale currentLocale] is not en_* (like ja_JP) formatter can't parse ISO string.

yas375 commented 9 years ago

The fix looks good to me! I remember I had similar problems (I'm not using MTDate's ISO date formatter, but my own). Would be nice also to have a unit test which covers this. Let me know if you don't want or don't have a time to write a unit test for this and I'm happy to help with it :)

hayashi311 commented 9 years ago

@yas375 Thank you for your offer. I'm trying to write a unit test. But it's difficult.

Settings for reproduce

The following setting occurs this bug. And this pull request resolves the problem.

When I turn 24-hour time on , It works. This is hard to understand for me. Maybe NSDateFormatter is depends on iOS Date & Time setting.

The Problem is there is no "Date & Time" in the setting.app of iOS simulator.

yas375 commented 9 years ago

@hayashi311 thanks for trying to test this! I'll try to figure this out on the weekend.

yas375 commented 9 years ago

I'm sorry, I didn't get a chance to write a test for this yet.

@atomkirk I think if you could also verify the fix with manual steps, then it worth to merge in. There is similar report too #58