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

DateTime field not working? #215

Closed
jackbbhua opened this issue May 30, 2017 · 8 comments
Closed

DateTime field not working? #215

jackbbhua opened this issue May 30, 2017 · 8 comments

Comments

@jackbbhua
Copy link

https://jsfiddle.net/h2qb542f/

please give some help for datepicker.thanks in advance for you help.

@dflock
Copy link
Collaborator

dflock commented May 31, 2017

This is what the datetime output looks like for me in devtools:

<div class="form-group field-dateTime">
  <label>
    DT
    <!---->
  </label>
  <div class="field-wrap">
    <field-datetime model="[object Object]" schema="[object Object]"></field-datetime>
    <!---->
  </div>
<!---->
<!---->
</div>

@dflock
Copy link
Collaborator

dflock commented May 31, 2017

Made some updates to the fiddle, but didn't fix anything:

  • Updated to latest vfg, 2.0.0-beta6
  • Changed data to a function
  • Added a dt property to data
  • Loaded the missing tether.js file

https://jsfiddle.net/tma9f3rr/3/

@dflock
Copy link
Collaborator

dflock commented May 31, 2017

Also tried type: "dateTimePicker", and wasn't able to get that to work immediately either: https://jsfiddle.net/tma9f3rr/6/ - same with type: "input", inputType: "datetime": https://jsfiddle.net/tma9f3rr/9/ - got Error: Invalid Date in fecha.format both times.

@dflock dflock changed the title DateTime field seems not works good. DateTime field not working? May 31, 2017
@icebob
Copy link
Member

icebob commented May 31, 2017

It's working, but not correct. https://jsfiddle.net/tma9f3rr/10/
The dateTimePicker can't handle if it is not initialized correcty. So I added dt: 1496216976762 to model and now there is no error. But it is a bug, need to fix it.

Plus have to load bootstrap css files too:
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css
https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css

@jackbbhua
Copy link
Author

thank you,icebob.i will update once you fixed it. 👍👍👍

@dflock dflock added this to the v2.0.0 milestone Jun 2, 2017
@Eduardoveras
Copy link

It also works if you put dt: Date.today

@icebob
Copy link
Member

icebob commented Jun 30, 2017

The dateTimePicker and date input are working if the model has no prop.
Ref

@bhavesh-786
Copy link

It's working, but not correct. https://jsfiddle.net/tma9f3rr/10/
The dateTimePicker can't handle if it is not initialized correcty. So I added dt: 1496216976762 to model and now there is no error. But it is a bug, need to fix it.

Plus have to load bootstrap css files too:
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css
https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css

Hello I am using you jsfiddle and it's work for date formate YYYY-MM-DD but while I am adding HH:mm:ss like dateTimePickerOptions: { format: "YYYY-MM-DD HH:mm:ss" } then calendar is not working why ? can you please help to solve calendar issue with time also . I am using vue bootstrap and VFG

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

No branches or pull requests

5 participants