Date picker with time

294 views
Skip to first unread message

Arbaz Sheikh

unread,
Dec 16, 2020, 10:12:58 AM12/16/20
to Blockly
Blockly provides support for Date picker as 'field_date' . Is there any support for Date picker with time? 
If not, what changes are required in field_date to achieve the same?

Abby Schmiedt

unread,
Dec 16, 2020, 2:16:50 PM12/16/20
to Blockly
Hello!

There is currently no support for a date picker with time. However, this could be a great plugin! I have added a feature request in blockly samples for this. Feel free to add any additional information if you think it would be helpful. 

The closure datepicker- which is what we use in the date field- does not have an option to set the time. You would need to add a way for the user to set the time in the dropdown yourself. You could do this by either adding html elements and css to the current date picker, or by finding a date picker that includes a time picker. Alternatively, you could create a separate time picker field and add this as well as a date picker field to your block. Either way, I don't think you will be able to get around creating your own custom field.

If you decide to go through with this and would like to contribute your creation back to the community there are some helpful docs on writing plugins.

Hope this helps and feel free to respond if you have more questions!

Abby
Reply all
Reply to author
Forward
0 new messages