Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
2beca22c
Commit
2beca22c
authored
May 09, 2016
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display "1 Jan" not "01 Jan"
parent
94b08517
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
time-test.js
h/static/scripts/test/time-test.js
+9
-9
time.js
h/static/scripts/time.js
+2
-2
No files found.
h/static/scripts/test/time-test.js
View file @
2beca22c
...
...
@@ -16,13 +16,13 @@ var FIXTURES_TO_FUZZY_STRING = [
[
3
*
minute
+
5
,
'3 min'
],
[
hour
,
'1 hr'
],
[
4
*
hour
,
'4 hr'
],
[
27
*
hour
,
'
0
1 Jan'
],
[
3
*
day
+
30
*
minute
,
'
0
1 Jan'
],
[
6
*
month
+
2
*
day
,
'
0
1 Jan'
],
[
1
*
year
,
'
0
1 Jan 1970'
],
[
1
*
year
+
2
*
month
,
'
0
1 Jan 1970'
],
[
2
*
year
,
'
0
1 Jan 1970'
],
[
8
*
year
,
'
0
1 Jan 1970'
]
[
27
*
hour
,
'1 Jan'
],
[
3
*
day
+
30
*
minute
,
'1 Jan'
],
[
6
*
month
+
2
*
day
,
'1 Jan'
],
[
1
*
year
,
'1 Jan 1970'
],
[
1
*
year
+
2
*
month
,
'1 Jan 1970'
],
[
2
*
year
,
'1 Jan 1970'
],
[
8
*
year
,
'1 Jan 1970'
]
];
var
FIXTURES_NEXT_FUZZY_UPDATE
=
[
...
...
@@ -58,9 +58,9 @@ describe('time', function () {
return
{
format
:
function
()
{
if
(
new
Date
().
getYear
()
===
70
)
{
return
'
0
1 Jan'
;
return
'1 Jan'
;
}
else
{
return
'
0
1 Jan 1970'
;
return
'1 Jan 1970'
;
}
}
};
...
...
h/static/scripts/time.js
View file @
2beca22c
...
...
@@ -78,11 +78,11 @@ function format(date, options, Intl) {
}
function
dayAndMonth
(
date
,
now
,
Intl
)
{
return
format
(
date
,
{
month
:
'short'
,
day
:
'
2-digit
'
},
Intl
);
return
format
(
date
,
{
month
:
'short'
,
day
:
'
numeric
'
},
Intl
);
}
function
dayAndMonthAndYear
(
date
,
now
,
Intl
)
{
return
format
(
date
,
{
day
:
'
2-digit
'
,
month
:
'short'
,
year
:
'numeric'
},
Intl
);
return
format
(
date
,
{
day
:
'
numeric
'
,
month
:
'short'
,
year
:
'numeric'
},
Intl
);
}
var
BREAKPOINTS
=
[
...
...
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