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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
80c90c20
Commit
80c90c20
authored
Nov 17, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shush eslint.
parent
705ca18e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
20 deletions
+19
-20
app/assets/javascripts/issuable_time_tracker.js.es6
app/assets/javascripts/issuable_time_tracker.js.es6
+1
-1
app/assets/javascripts/lib/utils/pretty_time.js.es6
app/assets/javascripts/lib/utils/pretty_time.js.es6
+1
-1
spec/javascripts/pretty_time_spec.js.es6
spec/javascripts/pretty_time_spec.js.es6
+17
-18
No files found.
app/assets/javascripts/issuable_time_tracker.js.es6
View file @
80c90c20
...
...
@@ -74,7 +74,7 @@
},
abbreviateTime(timeStr) {
return PrettyTime.abbreviateTime(timeStr);
}
}
,
},
template: `
<div class='time_tracker time-tracking-component-wrap' v-cloak>
...
...
app/assets/javascripts/lib/utils/pretty_time.js.es6
View file @
80c90c20
...
...
@@ -7,7 +7,7 @@
class PrettyTime {
/*
* Accepts seconds
(Number) and returns a timeObject: { weeks: #, days: #, hours: #, minutes: # }.
* Accepts seconds
and returns a timeObject { weeks: #, days: #, hours: #, minutes: # }
* Seconds can be negative or positive, zero or non-zero.
*/
static parseSeconds(seconds) {
...
...
spec/javascripts/pretty_time_spec.js.es6
View file @
80c90c20
//= require
lib/utils/pretty_tim
e
//= require
directives/tooltip_titl
e
(() => {
const PrettyTime = gl.PrettyTime;
describe('PrettyTime methods', function() {
describe('parseSeconds', function() {
it('should correctly parse a negative value', function() {
describe('PrettyTime methods', function
() {
describe('parseSeconds', function
() {
it('should correctly parse a negative value', function
() {
const parser = PrettyTime.parseSeconds;
const zeroSeconds = parser(-1000);
...
...
@@ -16,7 +16,7 @@
expect(zeroSeconds.weeks).toBe(0);
});
it('should correctly parse a zero value', function() {
it('should correctly parse a zero value', function
() {
const parser = PrettyTime.parseSeconds;
const zeroSeconds = parser(0);
...
...
@@ -27,7 +27,7 @@
expect(zeroSeconds.weeks).toBe(0);
});
it('should correctly parse a small non-zero second values', function() {
it('should correctly parse a small non-zero second values', function
() {
const parser = PrettyTime.parseSeconds;
const subOneMinute = parser(10);
...
...
@@ -52,7 +52,7 @@
expect(manyMinutes.weeks).toBe(0);
});
it('should correctly parse large second values', function() {
it('should correctly parse large second values', function
() {
const parser = PrettyTime.parseSeconds;
const aboveOneHour = parser(4800);
...
...
@@ -78,14 +78,13 @@
});
});
describe('stringifyTime', function() {
it('should stringify values with all non-zero units', function() {
describe('stringifyTime', function () {
it('should stringify values with all non-zero units', function () {
const timeObject = {
weeks: 1,
days: 4,
hours: 7,
minutes: 20
minutes: 20
,
};
const timeString = PrettyTime.stringifyTime(timeObject);
...
...
@@ -93,12 +92,12 @@
expect(timeString).toBe('1w 4d 7h 20m');
});
it('should stringify values with some non-zero units', function() {
it('should stringify values with some non-zero units', function
() {
const timeObject = {
weeks: 0,
days: 4,
hours: 0,
minutes: 20
minutes: 20
,
};
const timeString = PrettyTime.stringifyTime(timeObject);
...
...
@@ -106,12 +105,12 @@
expect(timeString).toBe('4d 20m');
});
it('should stringify values with no non-zero units', function() {
it('should stringify values with no non-zero units', function
() {
const timeObject = {
weeks: 0,
days: 0,
hours: 0,
minutes: 0
minutes: 0
,
};
const timeString = PrettyTime.stringifyTime(timeObject);
...
...
@@ -120,13 +119,13 @@
});
});
describe('abbreviateTime', function() {
it('should abbreviate stringified times for weeks', function() {
describe('abbreviateTime', function
() {
it('should abbreviate stringified times for weeks', function
() {
const fullTimeString = '1w 3d 4h 5m';
expect(PrettyTime.abbreviateTime(fullTimeString)).toBe('1w');
});
it('should abbreviate stringified times for non-weeks', function() {
it('should abbreviate stringified times for non-weeks', function
() {
const fullTimeString = '0w 3d 4h 5m';
expect(PrettyTime.abbreviateTime(fullTimeString)).toBe('3d');
});
...
...
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