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
06a440fc
Commit
06a440fc
authored
Feb 26, 2015
by
Nick Stenning
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1974 from hypothesis/1973-year-singular
Use a singular time expression one year
parents
27da8253
c15ed760
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
time-helpers.coffee
h/static/scripts/helpers/time-helpers.coffee
+1
-0
time-helpers-test.coffee
tests/js/helpers/time-helpers-test.coffee
+3
-0
No files found.
h/static/scripts/helpers/time-helpers.coffee
View file @
06a440fc
...
...
@@ -14,6 +14,7 @@ BREAKPOINTS = [
[
2
*
day
,
'yesterday'
,
day
]
[
month
,
'{} days ago'
,
day
]
[
year
,
'{} months ago'
,
month
]
[
2
*
year
,
'one year ago'
,
year
]
[
Infinity
,
'{} years ago'
,
year
]
]
...
...
tests/js/helpers/time-helpers-test.coffee
View file @
06a440fc
...
...
@@ -17,6 +17,9 @@ FIXTURES_TO_FUZZY_STRING = [
[
27
*
hour
,
'yesterday'
]
[
3
*
day
+
30
*
minute
,
'3 days ago'
]
[
6
*
month
+
2
*
day
,
'6 months ago'
]
[
1
*
year
,
'one year ago'
]
[
1
*
year
+
2
*
month
,
'one year ago'
]
[
2
*
year
,
'2 years ago'
]
[
8
*
year
,
'8 years ago'
]
]
...
...
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