Opened 10 years ago

Last modified 3 years ago

#10352 assigned enhancement

New DateTime Picker control

Reported by: komarneni Owned by: dylan
Priority: low Milestone: 1.15
Component: Dijit Version: 1.4.0b
Keywords: DateTime Picker Cc: Josh Trutwin, Bob Tarling
Blocked By: Blocking:

Description (last modified by bill)

This control will function more like a dijit.form.DateTextBox. it includes Date selection and Time picker. Right now there is no support for different formats and no tests are being developed yet. I would appreciate if users can suggest me with necessary improvements.

Attachments (2)

DateTimeWidget.js (3.4 KB) - added by komarneni 10 years ago.
Javascript file for DateTimeWidget?. This should be place in dijit folder
How.txt (839 bytes) - added by komarneni 10 years ago.
description to use datetimewidget.

Download all attachments as: .zip

Change History (24)

Changed 10 years ago by komarneni

Attachment: DateTimeWidget.js added

Javascript file for DateTimeWidget?. This should be place in dijit folder

Changed 10 years ago by komarneni

Attachment: How.txt added

description to use datetimewidget.

comment:1 Changed 10 years ago by bill

Hi Vamsi,

Thanks for attaching the patch. I have thought about adding such a control to dijit as usually date and time are entered together.

There are a number of things we need to do before this could go into dijit:

  • changes spaces to tabs, add comments, remove empty functions, and isn't postCreate() missing a closing bracket?
  • don't hardcode widths as pixels as that's not accessible (for people that set large font sizes)
  • write automated test using doh.robot, plus programmatic tests to make sure the API works
  • do styling in CSS, not hardcoded into JS file
  • attr('value') as getter and setter should work (rather than custom getDateTime()/setDateTime() API)
  • onMouseOut seems like it should be onMouseLeave, but not sure what that function is doing anyway (btw the first two lines are repeated)
  • I'm unclear on how this is supposed to function, is there one input box and when you click it a drop down with a Calendar and a TimePicker show up? Or two input boxes? Or is this widget just implementing the drop-down portion to a new DateTimeTextBox widget?
  • timezone correction: time and date will be displayed and editor in the client's timezone but the value received from the server and submitted to the server should be in GMT. For example, the user may input "Dec 25, 3am" but it will get submitted as "Dec 24, 11pm"
  • looks like there's no way to pass custom parameters to the DateTimePicker through to the underlying !Calendar and TimeTextBox widget.

comment:2 Changed 10 years ago by Adam Peller

see also #7946

comment:3 Changed 10 years ago by Josh Trutwin

Please add trutwijd to CC list

comment:4 Changed 10 years ago by Adam Peller

Cc: Josh Trutwin added

comment:5 Changed 7 years ago by sasdxm

I would also like to see a DateTime? picker implemented. Perhaps just something like the dojox/form/TimeSpinner added to the bottom of the dijit/form/DateTextBox calendar.

comment:6 Changed 7 years ago by bill

Priority: highlow

comment:7 Changed 7 years ago by Bob Tarling

Any chance that this or something similar could be pushed up the list?

Currently our app is using the DateTimeCombo? submitted in #7946 but I'd prefer to see something official from Dojo.

comment:8 Changed 7 years ago by Bob Tarling

I saw the comments on #7946 and see that is now rejected and the path is now this patch. Could someone please add me to cc on this defect so I can see when the milestone may get set.

comment:9 Changed 7 years ago by Adam Peller

Cc: Bob Tarling added

comment:10 Changed 7 years ago by gerhard presser

I'm also interested in an official solution - please CC me

comment:11 Changed 7 years ago by dylan

Milestone: future1.9
Owner: set to dylan
Status: newassigned

I'll look into getting something like this into 1.9 in dojox, or consider moving date/time extensions to a dojo foundation package if I have time to get things organized.

comment:12 Changed 7 years ago by Bob Tarling

As a suggetion -

Instead of creating a new widget how about adding this is an additional feature of the existing DateTextBox?.

A "defaultTime" property could be set to some fixed time to be applied to any date generated, e.g. "00:00:00" or "23:59:59". If this is left blank then have the DateTextBox? present the time for input by the user.

For backwards compatibility defaultTime can default to "00:00:00" if not specified.

This would manage a further feature request in the same control (I require a from/to date range input where the "to" date will assume end of day)

comment:13 Changed 7 years ago by bill

Description: modified (diff)

Since DateTextBox and TimeTextBox are already small subclasses of _DateTimeTextBox, the question is more how to do the drop down. I'm thinking of a TooltipDialog with a !Calendar and TimePicker in it.

The challenges there are that:

  1. TimePicker would need to be made accessible, ie focusable. Or make an accessible subclass.
  2. The design isn't suitable for apps that need to pick a time down to the minute or second. Too many choices in the TimePicker.
Last edited 7 years ago by bill (previous) (diff)

comment:14 Changed 7 years ago by bill

Milestone: 1.92.0

Since we released the beta for 1.9, presumably this enhancement should be bumped to 2.0.

comment:15 Changed 7 years ago by bill

Milestone: 2.01.10

Might as well check this into SVN and then merge to github, so it's available for the 1.x and 2.x streams.

comment:16 Changed 6 years ago by gerhard presser

any recent progress? is there any snapshot I could have a look at?

comment:17 Changed 6 years ago by George Sexton

I too would really like to have this. If it could get added to GitHub? that would be awesome.

comment:18 Changed 6 years ago by dylan

https://github.com/dylans/dojox/commit/7e0a8a5b6b86fa0b89289e0046b276fcc95d6b11 has an AMD-ified, somewhat cleaned-up version of this widget.

That said, as noted in the comment of the source code, this widget is not yet of great quality and needs help in the following areas to truly be useful:

  • Make it work with a11y
  • Allow date/time to be formatted via parameters instead of hardcoded
  • Use Dijit's dropdown capabilities
  • Test it on versions of IE and mobile devices
  • Verify that data integrity works when initializing
  • Declarative case fails
  • Widget cannot be closed if date or time is invalid
  • Reliance on a target node is somewhat strange
  • Add more test cases
  • Add inline API documentation

If people are interested in working on this, feel free to send pull requests against my branch. If there's no interest, I'm not sure when I'll find time to make this better, and it probably won't make it into 1.10 unless help is received on the above items.

If you do want to help, remember, you'll need to have a CLA on file.

comment:19 Changed 6 years ago by dylan

Milestone: 1.101.11

comment:20 Changed 5 years ago by asoltesz

I also think that this should be an official part of Dojo and should be implemented as soon as possible.

DateTime? fields are very numerous in business applications and Dojo is often selected for these projects since it feels like a natural choice for them (look and feel...etc).

Then, at 4 weeks into the project, it is a fairly big disappointment to find out that there is no component for such a common field-type and custom development is needed.

Using two widgets on the client is not really a solution since it is fairly complex (e.g.: merging the widget values into one hidden field...etc).

comment:21 Changed 4 years ago by dylan

Milestone: 1.111.12

While I would love to see this land already, we're out of time for 1.11.

comment:22 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.