evansmwendwa / ng2-daterangepicker

Usage Demos update in this url >>>
https://codesandbox.io/s/6yr1zm18w3
MIT License
132 stars 89 forks source link

All datepickers defaulting start of week to Monday #142

Open abney317 opened 4 years ago

abney317 commented 4 years ago

On the latest version of ng2-daterangepicker all of my date pickers are defaulting to Monday being the start of the week. I know there's options to change the day that is the start of the week, but isn't Sunday the default? I'm not sure how all of my date pickers are being set to a Monday start date when I haven't manually set them to do that.

image

Update: This actually seems to be a bug when using a daterangepicker on something other than an input field. If I visited a page with a daterangepicker that wasn't tied to an input field then the rest of my date pickers on the site would have weeks starting on Monday until I refreshed. (Was also using singleDatePicker)

evansmwendwa commented 3 years ago

Moment js should have a way of overriding the week start day. Also not sure if browser locale settings affect this in any way

laferil commented 3 years ago

I solved this by setting "firstDay: 0" in "locale" date options.