Re: [threeten-develop] wip/discordian
Status: Alpha
Brought to you by:
scolebourne
From: Stephen I. <clo...@ou...> - 2014-11-04 22:51:16
|
It does, thanks. That’s pretty much what I was expecting, it just ends up being more work. I may have a pull request for this calendar later this week. Stephen A. Imhoff From: Stephen Colebourne Sent: Wednesday, November 5, 2014 03:32 To: thr...@li... On 2 November 2014 23:58, Stephen Imhoff <clo...@ou...> wrote: > Well, for plus/minus (and day-of-year) that’s what I did (because it’s > closest to the behavior seen for February 29th). > But things get a little strange with until(…), because of how St. Tib’s Day > sits outside of the normal day-of-month/week count. You don’t have the > problem with the Gregorian/ISO leap day because it’s considered part of the > normal count of days, and it’s added at the end of the month. In the > Discordian calendar, the 59th and 60th days of the first month explicitly > stay those days of the month(and 4th and 5th day of the week, respectively), > even when St. Tib’s Day gets inserted between them. So my question was > really more about how much of an effect to make it have. > ie -> From 1/55 to St. Tib’s Day. This is a 5-day difference (no problem > with ChronoUnit.DAYS). However, the next same day-of-week is actually 1/60, > the day after St. Tib’s Day. Adding 1 week to 1/55 yields 1/60 always. > Subtracting 1 week from 1/60 and St. Tib’s Day yields 1/55 in both cases > (because of coercing St. Tib’s Day to 1/60 first), but when dealing with > until(…) we haven’t gotten to the same-of-unit yet. So do I silently coerce > it for until(…) too (easy), or go for a stricter, more “correct” > interpretation? 1/55 plus 5 days = StTibs 1/54 plus 1 week = 1/59 1/55 plus 1 week = 1/60 (plus week/month/year never lands on StTibs) from 1/55 until StTibs in days = 5 from 1/55 until 1/60 in days = 6 from 1/55 until StTibs in weeks = 0 from 1/55 until 1/60 in weeks = 1 But I'm not sure if that answers your question! >> WeekFields is entirely based on 7 day weeks, so I suspect its not >> worth trying to be clever there, > > Well, I could tell it’s based on 7-day weeks, my question was more about how > it was supposed to interact with calendars without 7-day weeks. > My initial assumption was that it should return the actual ISO day-of-week > (based on Epoch Day or something), but it seems to be returning the local > day-of-week (ie, 1-5 for the Discordian Calendar) instead. Is it just not > supported for calendars without 7-day weeks (and if so, should it throw an > error), or was my initial thought correct, and it should return the actual > ISO day-of-week? I think its just not supported. Stephen ------------------------------------------------------------------------------ _______________________________________________ threeten-develop mailing list thr...@li... https://lists.sourceforge.net/lists/listinfo/threeten-develop |