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 the deform.widget.DateTimeWidget widget, which uses the jQueryUI Timepicker add-on. #11

Merged
merged 3 commits into from Apr 6, 2011

Conversation

dnouri
Copy link
Member

@dnouri dnouri commented Mar 30, 2011

DateTimeWidget uses the ISO8601 combined date and time format
internally, as expected by colander.DateTime, but converts to the
more friendly separate date and time format for display in the widget.

jQueryUI Timepicker add-on.

``DateTimeWidget`` uses the ISO8601 combined date and time format
internally, as expected by ``colander.DateTime``, but converts to the
more friendly separate date and time format for display in the widget.
@dnouri
Copy link
Member Author

dnouri commented Mar 31, 2011

Let me know if I can help get this merged. If it were my birthday, I'd also wish for a new release. I have a package that's already depending on these changes. :-)

https://github.com/dnouri/kotti_calendar

@oO
Copy link

oO commented Mar 31, 2011

I just did something similar to a local branch. I have however created new types as well, called SimpleTime and SimpleDateTime, that strip the seconds and milliseconds.

The rationale is that any user facing data doesn't need that kind of precision. Imagine if you had a form to book a flight, and the date time widget asked you to fill in seconds?

I'm also looking into a javascript-based date-range validator, that would enforce start < end.

@dnouri
Copy link
Member Author

dnouri commented Mar 31, 2011

I'd rather keep using the datetime.date and datetime.datetime types because there's wide support for them. And worry about the user interface in the widget. The Timepicker add-on that I'm using here doesn't let you set seconds anyway.

@mcdonc
Copy link
Member

mcdonc commented Apr 2, 2011

This patch looks great. Unfortunately, the DateTime widget, while it works fine in Firefox 3, does not seem to work in Chromium. Could I tweak you into maybe testing/fixing that?

@mcdonc
Copy link
Member

mcdonc commented Apr 2, 2011

I should clarify "doesn't work"... no matter what input you provide to the widget in Chromium, it won't allow you to submit, claiming "Invalid value".

@dnouri
Copy link
Member Author

dnouri commented Apr 2, 2011

You're right. I think I need to use the datetime-local input type instead and stick to the somewhat cryptic combined ISO format. I was pretty naive about using input type="datetime".

http://dev.w3.org/html5/markup/input.datetime-local.html

@dnouri
Copy link
Member Author

dnouri commented Apr 3, 2011

I experimented with input type="datetime-local", but that's

  • using yet another format (combined with "T") where leaving out seconds is valid, which iso8601.py doesn't like,
  • not playing nicely with the jQuery widget so we'd have to not activate the widget when browser support for datetime-local exists, which would leave us with a very crude interface in Chrome where you only get +/- controls for minutes, and no calendar.

@mcdonc
Copy link
Member

mcdonc commented Apr 4, 2011

OK, I think without full features in IE, Chrome, FF this probably belongs in an add-on unless there's some way to get it all to go.

@dnouri
Copy link
Member Author

dnouri commented Apr 4, 2011

Well I implemented it with input type="text" and it seems to work fine everywhere. So this can go in unless you insist we use the HTML5 datetime-local input type.

@mcdonc
Copy link
Member

mcdonc commented Apr 4, 2011

Nope, no insistence here.. just let me know what to do.

@oO
Copy link

oO commented Apr 4, 2011

I would go with text. I'm happy to be HTML5 compliant, but only when it doesn't break HTML4+ while doing so. I think the datetime stuff falls in that category.

@dnouri
Copy link
Member Author

dnouri commented Apr 5, 2011

Hehe. So this last commit 7028e90 fixes the problem that you were seeing. I realise I might have confused you with my "I experimented with..." comment. Thanks.

@mcdonc mcdonc merged commit 7028e90 into Pylons:master Apr 6, 2011
@mcdonc
Copy link
Member

mcdonc commented Apr 6, 2011

Rock on. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants