Opened 11 years ago

Closed 6 years ago

#7946 closed enhancement (wontfix)

[patch] [cla] TimestampTextBox / DateTimeTextBox dijit

Reported by: afryer Owned by:
Priority: low Milestone: future
Component: DojoX Form Version: 1.2.0
Keywords: dijit DateTime Timestamp TextBox Cc: Adam Peller, Josh Trutwin
Blocked By: Blocking:

Description (last modified by bill)

There are a lot of people that would like to have a TimestampTextBox in dijit. I ended up creating one and am creating this ticket to share the source, which may be useful as a reference for creating the real dijit/form/TimestampTextBox, if you end up doing this.

Attachments (2) (56.6 KB) - added by afryer 11 years ago.
zip file containing implementation of a TimestampTextBox? (4.3 KB) - added by vlad 10 years ago.

Download all attachments as: .zip

Change History (22)

Changed 11 years ago by afryer

Attachment: added

zip file containing implementation of a TimestampTextBox?

comment:1 Changed 10 years ago by bill

Component: DijitDojoX Form
Description: modified (diff)
Owner: set to dante
Summary: TimestampTextBox / DateTimeTextBox dijit[patch] [cla] TimestampTextBox / DateTimeTextBox dijit

Hmm, I'd suggest to put this into DojoX form first.

comment:2 Changed 10 years ago by Jaanus Heeringson

I have tried this one out and even integrating it into the grid by basically duplicating and renaming the declaration for dojox.grid.cells.DateTextBox? in .../grid/cells/dijit.js. Works wonderfully - for me.

comment:3 Changed 10 years ago by Maciej Pestka

I've tried it too and it even works without modifying "grid.cells..." code ( the only modification needed is included number.patch). You just set "type" to "dojox.grid.cells._Widget", "widgetClass" to "majalin.dijit.TimestampTextBox?" and it works :).

It would be good to be able to hide seconds spinner using some parameter. I do not need seconds in my project (I removed it from template) but it could be better to be able to customize it.

It looks like date & time patterns are fixed:

postMixInProperties: function() {
	dojo.mixin(this.constraints, {
		datePattern: 'dd/MM/yyyy HH:mm:ss', 
		timePattern: 'HH:mm:ss'

I would suggest to remove this method to be able to pass custom formats in constraints.

Thank you for the widget!

comment:4 Changed 10 years ago by Adam Peller

Cc: Adam Peller added

comment:5 Changed 10 years ago by dante

Owner: changed from dante to Nathan Toone

nathan - this might be a great addition to dojox.form - please investigate.

comment:6 Changed 10 years ago by vlad

If my opinion counts any, please see if this can be added to the 1.2.x releases. As regular widget and as part of the grid.

It seems like in 1.2x Datagrid controls, you anyways already need to make changes (because all the controls use do not use attr( ) method to set values and generates warning)

I am generating my widgets dynamically from JSON and essentially for 'action-entry' I now have a single Dojo input widget. However the fact that there is no datetime widget causes me additional nesting logic because now I have to allow for more than one widget per my input field. And it is complicating my system enormously (database table changes/etc).

comment:7 Changed 10 years ago by Adam Peller

Sorry, maintenance releases are strictly limited to urgent bugs; enhancements aren't permitted. This would have to go in 1.3 or later.

comment:8 Changed 10 years ago by Nathan Toone

Milestone: tbdfuture

comment:9 Changed 10 years ago by Nathan Toone

Milestone: future1.4

comment:10 Changed 10 years ago by Nathan Toone

I am willing to add this to dojox.form, if someone is willing to attach a test case.

comment:11 Changed 10 years ago by vlad

Ok, I wanted to respond to toonetown response and provide a test case

But I ended up rewritting the Widget. It is based on the original concept of Antony (majalin above) but a) it uses the Time picker from dijit (it is there now) b) all the names are changed to fit into dojox.form namespace c) no separate stylsheet or template files d) all the set and get functions are changed and comply with 1.3.x 'attr set/get e) a test file is provided to show both programmatic and markup use f) I tested it within a grid as a grid cell but that test is not included g) I posted it on the dojo users list to ask for review last weeked but sofar did not get any responses. I had a question why I used the 'dijit' calendar popup and not the one in dojox -- I could add another Widget like this one only with a different name that uses that popup -- if that's desired or needed. just let me know.

I hope this can be reviewed and included (the zip file is attached).

having two separate widgets for date and time makes no sense for the application where the value has to be stored in one field. (as I indicated a while back my app looks at all the widgets in the page 'generically' in a loop needs a uniform access to all the widgets's data)

The screen shot is at

it is called dojox.form.DateTimeCombo?

Changed 10 years ago by vlad


comment:12 Changed 10 years ago by youngho

Unfortunately both patch doesn't set the hidden input field value propery. the hidden field value is just "date" format not Timestamp nor DateTime? format.

I think the hidden field value also should set the same as displayed value.

comment:13 Changed 10 years ago by Nathan Toone

vlad_dojo: have you signed a CLA?

comment:14 Changed 10 years ago by Josh Trutwin

please add trutwijd to CC list - thanks

comment:15 Changed 10 years ago by Nathan Toone

Cc: Josh Trutwin added

comment:16 Changed 10 years ago by Nathan Toone

Milestone: 1.4future

comment:17 Changed 9 years ago by jtoth55

I noticed this hasn't been updated in 7 months, is there any plan to get this into a release? It'd be great to have a date/time picker, for most cases it makes no sense to have a time picker that doesn't allow you to select the date.

comment:18 Changed 9 years ago by Adam Peller

see also #10352

comment:19 Changed 9 years ago by Nathan Toone

Owner: Nathan Toone deleted

Unassigning my tickets.

comment:20 Changed 6 years ago by bill

Resolution: wontfix
Status: newclosed

The TimestampTextBox idea is already supported as dijit/form/TimeTextBox. Dijit also has a DateTextBox. As for a DateTimeTextBox, that's covered by #10352.

Note: See TracTickets for help on using tickets.