3 ms·
I find it fascinating that it doesn't work between 1/1/13 and 1/6/13 but claims it will start working on 1/7/13. What is different about the 7th than the 6th?
by ChuckMcM 14y ago
I find it fascinating that it doesn't work between 1/1/13 and 1/6/13 but claims it will start working on 1/7/13. What is different about the 7th than the 6th?
- Derander 14y agoIt seems significant that this is exactly one week later.
- bdash 14y agoThe 7th is the first day of the second week of the year.
- evan_ 14y agoSo that seems like they're doing some kind of math using the week of year in the calculation- but for what purpose? The UI doesn't seem to give you any options for day of week, just time of day. Maybe there's code in there that checks day of week but it's hardcoded to run every day to make the UI simpler.
- Steko 14y agoSo maybe the service updates it's schedule weekly but the calculation ignores the year. This throws up an error at New Year's and borks the code that would reset when it's toggled on/off?
- nsoldiac 14y agoMaybe they're pushing an update on the 7th
- kijeda 14y agoI noticed a bug in another tool today, caused by the week-of-the-year value returned by strftime() returning '00' until the 6th. Possibly related?
- osiemens 14y agoIt's a not entirely uncommon bug having to do with the naming of the first week of the year. Perhaps it's even as deep as NSCalendar, but I can't check that right now. ref: http://stackoverflow.com/questions/1106943/nscalendar-first-day-of-week http://stackoverflow.com/questions/1106943/nscalendar-first-...
- VMG 14y agoOh yes. The ISO definition is pretty straightforward: «The first week of a year is the week that contains the first Thursday of the year.» (http://en.wikipedia.org/wiki/ISO_week_date http://en.wikipedia.org/wiki/ISO_week_date) Actual implementations often look more like this: http://www.epoch-calendar.com/support/getting_iso_week.html http://www.epoch-calendar.com/support/getting_iso_week.html Implementing it as a one-liner would be an interesting code golf exercise.
- MrHus 14y agoI fixed the same bug today, it happens when using YYYY instead of yyyy as a dateformat. YYYY is the year of the week the day falls in.
- lstrojny 14y agoCould you elaborate what exactly is the bug there?
- MrHus 14y agoIn my case I had a date that I needed to parse from JSON. It was in this format: 2012-01-21. I parsed it using YYYY-MM-dd. It should have been yyyy-MM-dd for the reasons above. It is not technically a bug but it real easy to get wrong. Perhaps they should have picked sometimg other than YYYY for week years.