-
Notifications
You must be signed in to change notification settings - Fork 169
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
Selecting days 1-11 of the month changes the format in the display field from DD/MM/YYYY to MM/DD/YYYY #168
Comments
check my comment in #162 |
Thank you for your response but I'm not quite sure how I can implement your recommendation in the above. I don;t have a fixed value I can pass in the moment(value) section because this is happening immediately when a user clicks into the date field. Are you able to provide any advice on implementing your solution to the helper code in the OP? |
Hi, |
Thanks for your comment afriqs, I think you've helped me resolve my issue. I think the problem was caused by the transform I was doing in my action using a variable called 'dateFrom'. See below
Using the above, as soon as my URL param was set, subsequent clicks into the component exhibited the behaviour described in the OP. 05-10-2018 was treated like 10-05-2018. I changed the name of 'dateFrom' to simply 'Testing' and the problem has resolved.
Now when I click back into the component the date is handled correctly and I have a much nicer URL |
<div class="col-sm-3"><label>Date From:</label>{{pikaday-input locale=en value=dateFrom format='DD/MM/YYYY' class="form-control" name="dateFrom" onSelection=(action 'onChangeDateFrom') }}</div>
In the date field using the above code, if a user selects a date between the 1st and 11th of the month the format of the date in the displpay field reverts from DD/MM/YYYY to MM/DD/YYYY. The date picker then behaves as if this is the selected date (ie if the user clicks back into the field, it will display the month from the MM/DD/YYYY format.)
I have these values being placed as query parameters in the URL string and they are inserted there correctly in a DD-MM-YYYY format, but even if the param is correct the field still displays the MM/DD/YYYY format.
The text was updated successfully, but these errors were encountered: