Commit a6dcbbf4 authored by Serge S. Koval's avatar Serge S. Koval

Datepicker accepts time without seconds.

parent d9f09d1c
......@@ -5,7 +5,8 @@
- Model Admin
- Ability to sort by fields that are not visible?
- List display callables
- Fields
- Form Fields
- Override field class by field name
- Verify how boolean field is rendered
- Search
- Rename init_search
......
......@@ -258,7 +258,7 @@
, getTimeString: function(s) {
var time = $('input', this.$time).val();
return this.validateTime(time) ? time : '12:00:00';
return this.getTime(time);
}
, pad: function(s) {
......@@ -291,6 +291,19 @@
return s.match(/^(\d{2,2}):(\d{2,2}):(\d{2,2})$/);
}
, getTime: function(s) {
if (this.validateTime(s)) {
return s;
} else {
// Time without seconds
if (s.match(/^(\d{2,2}):(\d{2,2})$/)) {
return s + ':00';
}
}
return '00:00:00';
}
, format: function(date) {
// Format a Date into a string as specified by RFC 3339.
var month = this.pad((date.getMonth() + 1).toString()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment