Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The weekDaysList is shifting when it is customized #68

Closed
Alel1909 opened this issue Aug 27, 2015 · 3 comments
Closed

The weekDaysList is shifting when it is customized #68

Alel1909 opened this issue Aug 27, 2015 · 3 comments

Comments

@Alel1909
Copy link

Hi,

First of all, thanks a lot for your great work !

I found a problem with the weekDaysList. I use you DatePicker to create several events, and each time I set a new date the weekDays are shifting one day to the left.

The first time I use it the list goes from Monday to Sunday (I set mondayFirst to true), the second from Tuesday to Monday, the next one from Wednesday to Tuesday etc.

The dates in the calendar stay in the good columns, only the letters above are shifting (so the second day I have the Tuesday letter above the Monday column).

I don't have this issue with the default weekDaysList, only when I customized it. I encounter this on both device and ionic serve.

Do you have an idea of where it could come from ? I'll work on it and keep you updated if I find something.

Thanks.

@rajeshwarpatlolla
Copy link
Owner

Could please share a video link if possible?

@punknroll
Copy link

I found out that error occurs if you have two datepickers using the same variable as weekDaysList and use the option mondyFirst:true because variables are passed by reference.

Configuration to reproduce:
http://pastebin.com/FgTW28rZ

I simply copied the object.

var myList = ['S', 'S', 'M', 'T', 'W', 'T', 'F']; 
$scope.startDatePickerObject = {
    weekDaysList: myList
}
$scope.endDatePickerObject = {
    weekDaysList: angular.copy(myList)
}

@rajeshwarpatlolla
Copy link
Owner

Yes, if you use more than one datepicker then you need create those many variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants