Closed byamla closed 6 years ago
huh.
just finally got to this. Here's what should be happening, I think. setTheDate in step 4(ish) - [firstofLastMonth] should not only set the date, but it also should have changed the display. And it clearly is not. My first guess is this is somewhere in the setTheDate logic, so I'm gonna start there.
This message really isn't asking for info, just letting you know that I have seen this, and am working on it.
As to why triggering close works, I've got nothing. I am also curious, though have not had time yet, to find out if this is a useInline artifact only.
Thanks!
Found it. So, in the mess that this has become, somewhere there is a "backup" date saved - as it happens, this logic fires when you click the previous/next button. I'll be honest, I don't know why that date got saved - I think it's because internally when you click previous, the date does change - in your example, the new date would have been the first day of last month, but that's the wrong answer as you only changes the control view, not the date.
What was not happening was the backup date didn't clear when you manually "setTheDate", and it absolutely should. If you explicitly set the date, DateBox should assume you meant to do that. So, now setting the date also clears the backup date from memory.
At any rate, at the "would expect...." step, I am now gettting the first of last month as you were right to expect.
This will hit in version 4.3.1, probably today sometime. I have a i18n update to do, then I can push it out the door.
Thanks for catching this.
Awesome. Thanks for the fix!
Using an inline calbox, setTheDate followed by getTheDate works as expected as long as I have not gone back or forward a month. If I do change months before calling setTheDate, getTheDate does not start to return me the correct value unless I manually trigger a "close" event (maybe to wipe this.calBackDate?).
To reproduce run this at http://dev.jtsage.com/DateBox/jqm/calbox/: