-
Notifications
You must be signed in to change notification settings - Fork 167
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
Set initial date and don't use the src from release by the moment. #113
Comments
I am looking for the lines where initial time is setted if initial data is given. Can someone indicate me where they are? Thanks! |
I have detected that, at some point when loading form, value for data input is wiped out after setted. I am looking for it. Help appreciated ;D |
When setting BrutusinForms.bootstrap.addFormatDecorator("date", "date") before BrutusinForms.create(schema), when form is loaded, form will override the value for the input with date decorator. I will study it to learn how to keep our decorator with our date picker. |
Ok, sorry, i was using the brutusin-json-forms.js from the release, which is older than the one in the last commit on master branch. The one in the master branch supports by default the time and date time without calling any decorator. So i am still having the same problem as before but, at least, i learned something: By the moment, PLEASE DON'T USE THE SRC FROM THE RELEASE! |
Eureka, I 've done it! i have modified the lines regarding the value set in brutusin-json-forms.js.
if (value !== null && typeof value !== "undefined") {
(I did my best with the formatting, but i don't know what is going on). It will be nice to commit it to master. I tried to make a pull request, but it seems i got to create a new branch, but the interface here is not letting me (maybe using git on a local machine?). Maybe if you help me out, we can get it done. Thanks! |
Actually you can use the "default" field. Eg:
|
Hi everyone!
How do i set a initial date in a string with date format?
I have tried this in the demo, but no luck, even when setting a proper date for input type date (YYYY-MM-DD) in the initial data like this:
{ date: "2018-1-13" }
Also not working with:
{ date: "2018-01-13T00:00:00" }
With time, it works like this:
{ time: "14:00" }
and schema (minimalist example):
{ "$schema": "http://json-schema.org/draft-03/schema#", "type": "object", "properties": { "time": { "type": "string", "format": "time" } } }
If there is no support, I can work on it.
Thanks in advance!
The text was updated successfully, but these errors were encountered: