mattlewis92 / angular-bootstrap-calendar

A port of the bootstrap calendar widget to AngularJS (no jQuery required!)
https://mattlewis92.github.io/angular-bootstrap-calendar/
MIT License
798 stars 369 forks source link

The calendar date is not correct #628

Closed zhengcongyin closed 7 years ago

zhengcongyin commented 7 years ago

Bug description / Feature request:

I just found the calendar Date is not correct. In your calendar, 2017-07-31 is Tuesday. In fact, it is Monday. Could you give me any hint to fix this problem

Link to minimally-working plunker that reproduces the issue (starter template: http://plnkr.co/edit/LE4F4U7AnnD3tjM9ZH4G?p=preview)

Versions

Angular: 1.6.6

Calendar library: 0.29.3

Browser name and version: 0.29.3

burtek commented 7 years ago

It looks ok to me. Did you notice the first column is Sunday, not Monday? If the bug only appears on your computer, could you provide screenshot?

image

EDIT: You can setup Monday as first day of week as described here:

To set Monday as the first day of the week, configure it in moment like so (even if using angular for formatting dates):

moment.locale('en_gb', {
  week : {
    dow : 1 // Monday is the first day of the week
  }
});
zhengcongyin commented 7 years ago

Thanks for your prompt reply. I attached the screen shot below. You can see 2017-07-31 is Tuesday, which is not correct. And on my computer, the first column is Monday. image

burtek commented 7 years ago

Well, on the screenshot it's even Wednesday, not Tuesday. Which is still odd. Does the example you linked in first post also produce this bug?

zhengcongyin commented 7 years ago

The plunker is not my code. I use your calendar in my asp.net project. I console.log viewDate, it is correct. I have no idea which part control this.

burtek commented 7 years ago

I guess we'll have to wait and see if @mattlewis92 has any idea, 'cause I give up here...

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.