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

Add DateTime Support #6

Open
huythuytq opened this issue Dec 12, 2014 · 4 comments
Open

Add DateTime Support #6

huythuytq opened this issue Dec 12, 2014 · 4 comments

Comments

@huythuytq
Copy link

Hi Tyler.

How to do handle create form date. I create form with type : datetime but error : Cannot read property "widget" of undefine.

@signalpoint
Copy link
Owner

@huythuytq Right now only the Date field is supported, not datetime or datestamp/timestamp. You can either change your field to be just a "Date" field, or you can modify the date.js file to try and accommodate the other types of date fields.

@signalpoint signalpoint changed the title How to do handle create form Add DateTime Support Dec 12, 2014
@huythuytq
Copy link
Author

Yes, my field is "Date". When I create content, it work fine, but I want handle create form, this is my code :

form.elements['appointments_date'] = {
            type : 'date',
            title : 'Appointment Date:',
        };

Console log show error : WARNING: _drupalgap_form_render_element_item() - Field date not supported.

@signalpoint
Copy link
Owner

@huythuytq The 'date' type is not a valid form element type. For example, when using a date field on a node, it's actually just a 'select' list(s). Essentially you need to design your element as a select list (or a text field, or other element types: http://drupalgap.org/node/274). You can utilize the 'children' array on your element to attach other widgets to the element to help build the user experience and attach various click handler(s), etc.

@huythuytq
Copy link
Author

Ok I see, thank you.

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

2 participants