Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e621696b
Commit
e621696b
authored
Dec 28, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 405898: Date/Time Fields should accept times like H:MM
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
b64f45e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
Util.pm
Bugzilla/Util.pm
+2
-2
field.js
js/field.js
+2
-5
No files found.
Bugzilla/Util.pm
View file @
e621696b
...
...
@@ -476,8 +476,8 @@ sub validate_time {
my
$ts
=
str2time
(
$time
);
if
(
$ts
)
{
$time2
=
time2str
(
"%H:%M:%S"
,
$ts
);
if
(
trim
(
$time
)
=~
/^\d\d:\d\d
$/
)
{
$time
.=
':00'
;
if
(
$time
=~
/^(\d{1,2}):(\d\d)(?::(\d\d))?
$/
)
{
$time
=
sprintf
(
"%02d:%02d:%02d"
,
$1
,
$2
,
$3
||
0
)
;
}
}
my
$ret
=
(
$ts
&&
$time
eq
$time2
);
...
...
js/field.js
View file @
e621696b
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment