Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
bffc2eea
Commit
bffc2eea
authored
Jun 15, 2012
by
Mark Cote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If found, use strftime function of date objects instead of built-in formatting.
parent
a54ec4ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
jquery.flot.time.js
jquery.flot.time.js
+7
-1
No files found.
jquery.flot.time.js
View file @
bffc2eea
...
@@ -15,6 +15,9 @@ for details.
...
@@ -15,6 +15,9 @@ for details.
// Returns a string with the date d formatted according to fmt.
// Returns a string with the date d formatted according to fmt.
// A subset of the Open Group's strftime format is supported.
// A subset of the Open Group's strftime format is supported.
function
formatDate
(
d
,
fmt
,
monthNames
,
dayNames
)
{
function
formatDate
(
d
,
fmt
,
monthNames
,
dayNames
)
{
if
(
typeof
d
.
strftime
==
"function"
)
{
return
d
.
strftime
(
fmt
);
}
var
leftPad
=
function
(
n
,
pad
)
{
var
leftPad
=
function
(
n
,
pad
)
{
n
=
""
+
n
;
n
=
""
+
n
;
pad
=
""
+
(
pad
==
null
?
"0"
:
pad
);
pad
=
""
+
(
pad
==
null
?
"0"
:
pad
);
...
@@ -82,11 +85,14 @@ for details.
...
@@ -82,11 +85,14 @@ for details.
targetMethod
)
{
targetMethod
)
{
sourceObj
[
sourceMethod
]
=
function
()
{
sourceObj
[
sourceMethod
]
=
function
()
{
return
targetObj
[
targetMethod
].
apply
(
targetObj
,
arguments
);
return
targetObj
[
targetMethod
].
apply
(
targetObj
,
arguments
);
}
}
;
};
};
var
utc
=
{
var
utc
=
{
date
:
d
date
:
d
};
};
// support strftime, if found
if
(
d
.
strftime
!=
undefined
)
addProxyMethod
(
utc
,
"strftime"
,
d
,
"strftime"
);
addProxyMethod
(
utc
,
"getTime"
,
d
,
"getTime"
);
addProxyMethod
(
utc
,
"getTime"
,
d
,
"getTime"
);
addProxyMethod
(
utc
,
"setTime"
,
d
,
"setTime"
);
addProxyMethod
(
utc
,
"setTime"
,
d
,
"setTime"
);
var
props
=
[
"Date"
,
"Day"
,
"FullYear"
,
"Hours"
,
"Milliseconds"
,
"Minutes"
,
"Month"
,
"Seconds"
];
var
props
=
[
"Date"
,
"Day"
,
"FullYear"
,
"Hours"
,
"Milliseconds"
,
"Minutes"
,
"Month"
,
"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