-
Notifications
You must be signed in to change notification settings - Fork 80
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
1179 - Datepicker: Ability to set first day of week #1326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericangeles see below
|
||
<script> | ||
$('body').on('initialized', function () { | ||
Locale.currentLocale.data.calendars[0].firstDayofWeek = 1; // starts on Monday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this type of fix is in "workaround" territory, only because it could potentially be unstable to the Locale system if it's using this property internally for other calendar functions. #1179 actually lists out that a Datepicker API setting for changing the first day of the week would be desirable. I'm thinking that would be a better fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @ericangeles should have made this one more clear. To add some direction:
- add a setting firstDayOfWeek on the monthview component and datepicker component (datepicker one just sends it to month view)
- its initially null, if not set use Locale firstDayOfWeek but if it is set use the setting value instead of whats set in the locale (dont change the locale)
- add api tests ext.
- update the example to show the setting not the workaround
<script> | ||
$('body').on('initialized', function () { | ||
Locale.currentLocale.data.calendars[0].firstDayofWeek = 1; // starts on Monday | ||
$('my-datepicker').datepicker(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should prob be #date-field-normal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Change as noted to add docs
- Change as noted to not change the local and instead override in month view
- Add a functional test
- Merge master on to fix build problems.
In addition to our comments will want to merge master to fix the tests |
Explain the details for making this change. What existing problem does the pull request solve?
Adding a test template that will control the first day on the datepicker.
Adding a firstDayofWeek option to datepicker that overrides whats used in locale.
Related github/jira issue (required):
Closes #1179
Steps necessary to review your pull request (required):
firstDayofWeek