Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
3f55e0b2
Commit
3f55e0b2
authored
Jun 03, 2018
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the default strings of timeago.js for timeago
parent
fe0ebf76
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
app/assets/javascripts/lib/utils/datetime_utility.js
app/assets/javascripts/lib/utils/datetime_utility.js
+18
-18
changelogs/unreleased/47182-use-the-default-strings-of-timeago-js.yml
...nreleased/47182-use-the-default-strings-of-timeago-js.yml
+5
-0
spec/features/admin/admin_uses_repository_checks_spec.rb
spec/features/admin/admin_uses_repository_checks_spec.rb
+1
-1
spec/features/merge_request/user_posts_notes_spec.rb
spec/features/merge_request/user_posts_notes_spec.rb
+1
-1
No files found.
app/assets/javascripts/lib/utils/datetime_utility.js
View file @
3f55e0b2
...
...
@@ -79,37 +79,37 @@ export function getTimeago() {
if
(
!
timeagoInstance
)
{
const
localeRemaining
=
function
getLocaleRemaining
(
number
,
index
)
{
return
[
[
s__
(
'
Timeago|
less than a minute ago
'
),
s__
(
'
Timeago|right now
'
)],
[
s__
(
'
Timeago|
less than a minute
ago
'
),
s__
(
'
Timeago|%s seconds remaining
'
)],
[
s__
(
'
Timeago|
about a
minute ago
'
),
s__
(
'
Timeago|1 minute remaining
'
)],
[
s__
(
'
Timeago|
just now
'
),
s__
(
'
Timeago|right now
'
)],
[
s__
(
'
Timeago|
%s seconds
ago
'
),
s__
(
'
Timeago|%s seconds remaining
'
)],
[
s__
(
'
Timeago|
1
minute ago
'
),
s__
(
'
Timeago|1 minute remaining
'
)],
[
s__
(
'
Timeago|%s minutes ago
'
),
s__
(
'
Timeago|%s minutes remaining
'
)],
[
s__
(
'
Timeago|
about an
hour ago
'
),
s__
(
'
Timeago|1 hour remaining
'
)],
[
s__
(
'
Timeago|
about
%s hours ago
'
),
s__
(
'
Timeago|%s hours remaining
'
)],
[
s__
(
'
Timeago|
a
day ago
'
),
s__
(
'
Timeago|1 day remaining
'
)],
[
s__
(
'
Timeago|
1
hour ago
'
),
s__
(
'
Timeago|1 hour remaining
'
)],
[
s__
(
'
Timeago|%s hours ago
'
),
s__
(
'
Timeago|%s hours remaining
'
)],
[
s__
(
'
Timeago|
1
day ago
'
),
s__
(
'
Timeago|1 day remaining
'
)],
[
s__
(
'
Timeago|%s days ago
'
),
s__
(
'
Timeago|%s days remaining
'
)],
[
s__
(
'
Timeago|
a
week ago
'
),
s__
(
'
Timeago|1 week remaining
'
)],
[
s__
(
'
Timeago|
1
week ago
'
),
s__
(
'
Timeago|1 week remaining
'
)],
[
s__
(
'
Timeago|%s weeks ago
'
),
s__
(
'
Timeago|%s weeks remaining
'
)],
[
s__
(
'
Timeago|
a
month ago
'
),
s__
(
'
Timeago|1 month remaining
'
)],
[
s__
(
'
Timeago|
1
month ago
'
),
s__
(
'
Timeago|1 month remaining
'
)],
[
s__
(
'
Timeago|%s months ago
'
),
s__
(
'
Timeago|%s months remaining
'
)],
[
s__
(
'
Timeago|
a
year ago
'
),
s__
(
'
Timeago|1 year remaining
'
)],
[
s__
(
'
Timeago|
1
year ago
'
),
s__
(
'
Timeago|1 year remaining
'
)],
[
s__
(
'
Timeago|%s years ago
'
),
s__
(
'
Timeago|%s years remaining
'
)],
][
index
];
};
const
locale
=
function
getLocale
(
number
,
index
)
{
return
[
[
s__
(
'
Timeago|
less than a minute ago
'
),
s__
(
'
Timeago|right now
'
)],
[
s__
(
'
Timeago|
less than a minute
ago
'
),
s__
(
'
Timeago|in %s seconds
'
)],
[
s__
(
'
Timeago|
about a
minute ago
'
),
s__
(
'
Timeago|in 1 minute
'
)],
[
s__
(
'
Timeago|
just now
'
),
s__
(
'
Timeago|right now
'
)],
[
s__
(
'
Timeago|
%s seconds
ago
'
),
s__
(
'
Timeago|in %s seconds
'
)],
[
s__
(
'
Timeago|
1
minute ago
'
),
s__
(
'
Timeago|in 1 minute
'
)],
[
s__
(
'
Timeago|%s minutes ago
'
),
s__
(
'
Timeago|in %s minutes
'
)],
[
s__
(
'
Timeago|
about an
hour ago
'
),
s__
(
'
Timeago|in 1 hour
'
)],
[
s__
(
'
Timeago|
about
%s hours ago
'
),
s__
(
'
Timeago|in %s hours
'
)],
[
s__
(
'
Timeago|
a
day ago
'
),
s__
(
'
Timeago|in 1 day
'
)],
[
s__
(
'
Timeago|
1
hour ago
'
),
s__
(
'
Timeago|in 1 hour
'
)],
[
s__
(
'
Timeago|%s hours ago
'
),
s__
(
'
Timeago|in %s hours
'
)],
[
s__
(
'
Timeago|
1
day ago
'
),
s__
(
'
Timeago|in 1 day
'
)],
[
s__
(
'
Timeago|%s days ago
'
),
s__
(
'
Timeago|in %s days
'
)],
[
s__
(
'
Timeago|
a
week ago
'
),
s__
(
'
Timeago|in 1 week
'
)],
[
s__
(
'
Timeago|
1
week ago
'
),
s__
(
'
Timeago|in 1 week
'
)],
[
s__
(
'
Timeago|%s weeks ago
'
),
s__
(
'
Timeago|in %s weeks
'
)],
[
s__
(
'
Timeago|
a
month ago
'
),
s__
(
'
Timeago|in 1 month
'
)],
[
s__
(
'
Timeago|
1
month ago
'
),
s__
(
'
Timeago|in 1 month
'
)],
[
s__
(
'
Timeago|%s months ago
'
),
s__
(
'
Timeago|in %s months
'
)],
[
s__
(
'
Timeago|
a
year ago
'
),
s__
(
'
Timeago|in 1 year
'
)],
[
s__
(
'
Timeago|
1
year ago
'
),
s__
(
'
Timeago|in 1 year
'
)],
[
s__
(
'
Timeago|%s years ago
'
),
s__
(
'
Timeago|in %s years
'
)],
][
index
];
};
...
...
changelogs/unreleased/47182-use-the-default-strings-of-timeago-js.yml
0 → 100644
View file @
3f55e0b2
---
title
:
Use the default strings of timeago.js for timeago
merge_request
:
19350
author
:
Takuya Noguchi
type
:
other
spec/features/admin/admin_uses_repository_checks_spec.rb
View file @
3f55e0b2
...
...
@@ -28,7 +28,7 @@ feature 'Admin uses repository checks' do
visit_admin_project_page
(
project
)
page
.
within
(
'.alert'
)
do
expect
(
page
.
text
).
to
match
(
/Last repository check \(
.* ago
\) failed/
)
expect
(
page
.
text
).
to
match
(
/Last repository check \(
just now
\) failed/
)
end
end
...
...
spec/features/merge_request/user_posts_notes_spec.rb
View file @
3f55e0b2
...
...
@@ -139,7 +139,7 @@ describe 'Merge request > User posts notes', :js do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note_edited_ago'
)
expect
(
find
(
'.note_edited_ago'
).
text
)
.
to
match
(
/
less than a minute ago
/
)
.
to
match
(
/
just now
/
)
end
end
end
...
...
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