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

Setting value to DD/MM/YYYY does not work #162

Open
rizkysyazuli opened this issue Jul 29, 2017 · 3 comments
Open

Setting value to DD/MM/YYYY does not work #162

rizkysyazuli opened this issue Jul 29, 2017 · 3 comments

Comments

@rizkysyazuli
Copy link

rizkysyazuli commented Jul 29, 2017

My model returns data in dd/mm/yyyy format. Passing this value of ember-pikaday does not work and the input is blank.

{{#each parent.child_list as |child index|}}
  ...
  {{pikaday-input firstDay=0 format="DD/MM/YYYY" yearRange="2010,currentYear" name="child_dob[]" id=(concat 'child_dob-' index) value=child.dob placeholder="hh/bb/tttt"}}
  ...
{{/each}}

The child.dob value looks something like this 18/07/2017. I even try to put a static value in there and the result is the same. It works when i changed it into 07/18/2017 (mm/dd/yyyy).

@duizendnegen
Copy link
Contributor

Could you replicate this in https://ember-twiddle.com/?

@thiberaw
Copy link

thiberaw commented Feb 1, 2018

Ok, I figured out why.
You're passing 18/07/2017 as value, but the addon can't know that your date is already DD/MM/YYYY formated so the switch is applied.
If you pass 07/18/2017 (en) as value and the DD/MM/YYYY you'll get the date you were looking for.

@thiberaw
Copy link

thiberaw commented Feb 1, 2018

if you do moment('12-07-2018').format('DD-MM-YYYY') you'll get 07-12-2018

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