Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
jio
Commits
2bac7b8a
Commit
2bac7b8a
authored
Mar 18, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added JIODate.prototype.toString()
parent
ecee078b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
src/jio.date/jiodate.js
src/jio.date/jiodate.js
+6
-0
test/queries/jiodate.tests.js
test/queries/jiodate.tests.js
+12
-2
No files found.
src/jio.date/jiodate.js
View file @
2bac7b8a
...
...
@@ -72,6 +72,7 @@
}
this
.
mom
=
null
;
this
.
_str
=
str
;
// http://www.w3.org/TR/NOTE-datetime
// http://dotat.at/tmp/ISO_8601-2004_E.pdf
...
...
@@ -155,6 +156,11 @@
};
JIODate
.
prototype
.
toString
=
function
()
{
return
this
.
_str
;
};
_export
(
'
JIODate
'
,
JIODate
);
_export
(
'
YEAR
'
,
YEAR
);
...
...
test/queries/jiodate.tests.js
View file @
2bac7b8a
...
...
@@ -170,6 +170,18 @@
});
test
(
"
The toString() method should retain the precision
"
,
function
()
{
var
d
;
d
=
JIODate
(
'
2012-05-08
'
);
strictEqual
(
d
.
toString
(),
'
2012-05-08
'
);
d
=
JIODate
(
'
2012-05
'
);
strictEqual
(
d
.
toString
(),
'
2012-05
'
);
d
=
JIODate
(
'
2012
'
);
strictEqual
(
d
.
toString
(),
'
2012
'
);
});
test
(
"
Parsing of partial timestamp values with any precision
"
,
function
()
{
var
d
;
...
...
@@ -207,7 +219,6 @@
strictEqual
(
d
.
getPrecision
(),
'
year
'
);
strictEqual
(
d
.
toPrecisionString
(),
'
2012
'
);
strictEqual
(
d
.
mom
.
toISOString
(),
'
2012-01-01T00:00:00.000Z
'
);
});
...
...
@@ -272,7 +283,6 @@
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:07
'
)),
+
1
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:08
'
)),
0
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:09
'
)),
-
1
);
});
...
...
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