Looks like the date picker has fallen 1 day out of sync with no changes to my app.
Is this happening to anyone else?
Date on datepicker is shown as Thursday 17th Oct.
Looks like the date picker has fallen 1 day out of sync with no changes to my app.
Is this happening to anyone else?
Date on datepicker is shown as Thursday 17th Oct.
Hi @stu,
We recently made some changes to the underlying implementation of the DatePicker, so it looks like we may have introduced a bug.
However, I can’t seem to reproduce this in a new app if I add the DatePicker component. Was this an existing app with an existing DatePicker or a new app?
Hi Brooke, this is an existing app with an existing datepicker.
I’m unable to run any tests if my own right now to try and reproduce the bug but I will as soon as I am able to.
Hi @stu,
Thanks for update. Please can you give it another try again now? We believe the issue should be resolved.
Hi @stu,
for further investigation could you provide some information about where you were seeing this?
The browser, and timezone would be handy.
Thanks
Yes, no problem,
Chrome browser, tested both in Miami, FL, USA (GMT-4), and Sheffield, England (GMT+1 / BST) and the same issue existed in both time zones at the time.
I was travelling with only my phone available at the time so couldn’t investigate the issue before it was resolved.
Looking into this further now, the standard anvil DatePicker defaults to a Sunday day of week start. At some point in the past (many years ago so memory is a little fuzzy), I’ve added the following to the html head to change the picker to a Monday. This is probably the cause of the issue.
<script>
// make first day of week monday
document.addEventListener("DOMContentLoaded", () => {
moment.updateLocale("en", {
week: { dow: 1 },
});
});
</script>
Hope that helps
Perfect thanks. That’s what I needed! Thanks for investigating.