aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-12-28 04:39:27 +0000
committermkanat%bugzilla.org <>2007-12-28 04:39:27 +0000
commite621696be0f092e348e4534e1855c0a3146c2c9e (patch)
treee55440a75a01c46020d8397785bcbf6b827a11e7 /js
parentb64f45e6ba9bfb002657204411b8e7686b102f02 (diff)
downloadbugs-e621696be0f092e348e4534e1855c0a3146c2c9e.tar
bugs-e621696be0f092e348e4534e1855c0a3146c2c9e.tar.gz
bugs-e621696be0f092e348e4534e1855c0a3146c2c9e.tar.bz2
bugs-e621696be0f092e348e4534e1855c0a3146c2c9e.tar.xz
bugs-e621696be0f092e348e4534e1855c0a3146c2c9e.zip
Bug 405898: Date/Time Fields should accept times like H:MM
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'js')
-rw-r--r--js/field.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/js/field.js b/js/field.js
index 97f1cb7a1..ca58329f4 100644
--- a/js/field.js
+++ b/js/field.js
@@ -85,7 +85,7 @@ function setFieldFromCalendar(type, args, date_field) {
// We can't just write the date straight into the field, because there
// might already be a time there.
- var timeRe = /(\d\d):(\d\d)(?::(\d\d))?/;
+ var timeRe = /\b(\d{1,2}):(\d\d)(?::(\d\d))?/;
var currentTime = timeRe.exec(date_field.value);
var d = new Date(setDate[0], setDate[1] - 1, setDate[2]);
if (currentTime) {
@@ -104,9 +104,6 @@ function setFieldFromCalendar(type, args, date_field) {
var dateStr = year + '-' + month + '-' + day;
if (currentTime) {
- var hours = d.getHours();
- if (hours < 10) hours = '0' + String(hours);
- d.setHours(hours);
var minutes = d.getMinutes();
if (minutes < 10) minutes = '0' + String(minutes);
var seconds = d.getSeconds();
@@ -114,7 +111,7 @@ function setFieldFromCalendar(type, args, date_field) {
seconds = '0' + String(seconds);
}
- dateStr = dateStr + ' ' + hours + ':' + minutes;
+ dateStr = dateStr + ' ' + d.getHours() + ':' + minutes;
if (seconds) dateStr = dateStr + ':' + seconds;
}