I found a bug related to calendar view and after investigating I found a mistake in hexagon.js code in function:
DateTimeLocalizerMoment.prototype.weekDays = function()
line 6924:
dayDate = moment().weekday(0);
line 6925:
dayDate.locale(this.locale());
After setting dayDate starts from 0 you’re setting a locale, but locale doesn’t affect anything.
Despite this locale settings we can see on Calendar that week starts from Sunday event if I changed locale (where week starts from Monday for example).
There is should be another order of settings:
first set locale and then set weekday like this:
dayDate = moment().locale(this.locale()).weekday(0);
Instead of these 2 lines of code:
dayDate = moment().weekday(0);
dayDate.locale(this.locale());
After testing my method I could see the correct view of Calendar regarding to locale.
Checklist:
[x] I have added a tag to this pull request that indicates the impact of the change (patch, minor or major)
[x] My code follows the code style of this project.
[x] I have updated the documentation accordingly. (This includes updating the changelog).
[x] I have read the CONTRIBUTING document. (Last updated 24 March 2020)
Description
I found a bug related to calendar view and after investigating I found a mistake in hexagon.js code in function: DateTimeLocalizerMoment.prototype.weekDays = function() line 6924: dayDate = moment().weekday(0); line 6925: dayDate.locale(this.locale()); After setting dayDate starts from 0 you’re setting a locale, but locale doesn’t affect anything. Despite this locale settings we can see on Calendar that week starts from Sunday event if I changed locale (where week starts from Monday for example). There is should be another order of settings: first set locale and then set weekday like this: dayDate = moment().locale(this.locale()).weekday(0); Instead of these 2 lines of code: dayDate = moment().weekday(0); dayDate.locale(this.locale()); After testing my method I could see the correct view of Calendar regarding to locale.
Checklist: