Vue-form-generator: How to use pikaday for cross-browser date selection?

Created on 25 Jun 2017  路  5Comments  路  Source: vue-generators/vue-form-generator

I am trying to use pikaday as an alternative to bugs raised by #231.

However, I cannot seem to get dates to work.

I have created a fiddle.

Issues I'm facing:

  1. The form has the same bug as #231. Entering values with the keyboard gives incorrect results.
  2. Selecting a value from the pop-up calendar does not seem to set the model value. Note, the value of dob in the model does not change.

Please update my example to demonstrate the use of pikaday.

Most helpful comment

@cesarmarinhorj Thanks for the snippet. My pikaday input was returning false (!?), with your snippet it works, but it is still a hack (in my case), as it should just work. I have to understand what is happening and fix it properly. So for future references and if someone is having the same problem: my input returns false, and as soon as you select for the first time it returns 1970-01-01, and even though after the second selection it works, the model has the "false" boolean value.

When/if I find the solution I post here.

All 5 comments

The field is working, but there was a circular JSON stringify error when tried to prettyJSON the schema.

https://jsfiddle.net/icebob/6tkhy8m9/2/

How about the first point; I seem unable to successfully enter a pick using the keyboard

pikadayOptions: {
onSelect: function(date){
vm.model.myDate = date;
console.log(date);
}
}

@cesarmarinhorj Hi Cesar. Can you provide more explanation? What am I supposed to do with this information? Where does it go in the code? What is this reference to pikadayOptions? How is it passed/used? Maybe a fiddle would be useful.

Thank you

@cesarmarinhorj Thanks for the snippet. My pikaday input was returning false (!?), with your snippet it works, but it is still a hack (in my case), as it should just work. I have to understand what is happening and fix it properly. So for future references and if someone is having the same problem: my input returns false, and as soon as you select for the first time it returns 1970-01-01, and even though after the second selection it works, the model has the "false" boolean value.

When/if I find the solution I post here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zwx00 picture zwx00  路  3Comments

Stephen9s picture Stephen9s  路  4Comments

sjordan1975 picture sjordan1975  路  5Comments

LouWii picture LouWii  路  4Comments

lionel-bijaoui picture lionel-bijaoui  路  5Comments