You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been investigating another Calendar issue (more of which in another issue), I came across this delight
Note that February, April and June are not there but some other month
On investigation the wikitext
{{#time:F|2000-02}}
demonstrates the issue, returning
March
Further delving, I have found in 400_xowa\src\gplx\xowa\xtns\pfuncs\times\Pxd_parser.java what I suspect is the culprit.
At the moment, here, the date is 31th December 2019.
The current date is used to supply values that are missing when calculating a date, the wikitext is only supplying two values - year and month, xowa is supplying the day. This leads to, in this case, a date of 2000-02-31, which down in the depths of java converts to 2000-03-02 (as 2000 was a leap year), The F format is the full month hence March
Defaulting to the current day seems the correct approach - except in this case
More cumbersomebly, if ONLY a year is specified, month should be 1, day should be 1 (say?!)
and if ONLY a year and a month are specified, day should be 1
What do you think?
The text was updated successfully, but these errors were encountered:
On further thought, I am currently going with some logic of the form
If setting a month value - check the day value and see if that day falls within the number of days for that month, if not set to the maximum for that month
This means I have needed to have a getter as well as a setter in 400_xowa\src\gplx\xowa\xtns\pfuncs\times\Pxd_date_bldr.java
That is, Seg_get(idx)
Hi, sorry for lack of check-in on my side. I'm still working on #633. I should be finally finished in the next few days, and will reply to this issue and others as well. Thanks for filing the issue, and I will reply soon.
I have been investigating another Calendar issue (more of which in another issue), I came across this delight
![yearcalendar](https://user-images.githubusercontent.com/861631/71623346-c6b3fe00-2bd3-11ea-9563-020638cab66b.gif)
Note that February, April and June are not there but some other month
On investigation the wikitext
demonstrates the issue, returning
Further delving, I have found in 400_xowa\src\gplx\xowa\xtns\pfuncs\times\Pxd_parser.java what I suspect is the culprit.
At the moment, here, the date is 31th December 2019.
The current date is used to supply values that are missing when calculating a date, the wikitext is only supplying two values - year and month, xowa is supplying the day. This leads to, in this case, a date of
2000-02-31
, which down in the depths of java converts to2000-03-02
(as 2000 was a leap year), TheF
format is the full month henceMarch
Defaulting to the current day seems the correct approach - except in this case
More cumbersomebly, if ONLY a year is specified, month should be 1, day should be 1 (say?!)
and if ONLY a year and a month are specified, day should be 1
What do you think?
The text was updated successfully, but these errors were encountered: