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
d8d699ff
Commit
d8d699ff
authored
Aug 25, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert datetime coffeescript spec to ES6
parent
33a367e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
50 deletions
+65
-50
CHANGELOG
CHANGELOG
+1
-0
spec/javascripts/datetime_utility_spec.js.coffee
spec/javascripts/datetime_utility_spec.js.coffee
+0
-50
spec/javascripts/datetime_utility_spec.js.es6
spec/javascripts/datetime_utility_spec.js.es6
+64
-0
No files found.
CHANGELOG
View file @
d8d699ff
...
...
@@ -58,6 +58,7 @@ v 8.12.0 (unreleased)
- Move to project dropdown with infinite scroll for better performance
- Fix leaking of submit buttons outside the width of a main container !18731 (originally by @pavelloz)
- Load branches asynchronously in Cherry Pick and Revert dialogs.
- Convert datetime coffeescript spec to ES6 (ClemMakesApps)
- Add merge request versions !5467
- Change using size to use count and caching it for number of group members. !5935
- Replace play icon font with svg (ClemMakesApps)
...
...
spec/javascripts/datetime_utility_spec.js.coffee
deleted
100644 → 0
View file @
33a367e8
#= require lib/utils/datetime_utility
describe
'Date time utils'
,
->
describe
'get day name'
,
->
it
'should return Sunday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/17/2016'
))
expect
(
day
).
toBe
(
'Sunday'
)
it
'should return Monday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/18/2016'
))
expect
(
day
).
toBe
(
'Monday'
)
it
'should return Tuesday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/19/2016'
))
expect
(
day
).
toBe
(
'Tuesday'
)
it
'should return Wednesday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/20/2016'
))
expect
(
day
).
toBe
(
'Wednesday'
)
it
'should return Thursday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/21/2016'
))
expect
(
day
).
toBe
(
'Thursday'
)
it
'should return Friday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/22/2016'
))
expect
(
day
).
toBe
(
'Friday'
)
it
'should return Saturday'
,
->
day
=
gl
.
utils
.
getDayName
(
new
Date
(
'07/23/2016'
))
expect
(
day
).
toBe
(
'Saturday'
)
describe
'get day difference'
,
->
it
'should return 7'
,
->
firstDay
=
new
Date
(
'07/01/2016'
)
secondDay
=
new
Date
(
'07/08/2016'
)
difference
=
gl
.
utils
.
getDayDifference
(
firstDay
,
secondDay
)
expect
(
difference
).
toBe
(
7
)
it
'should return 31'
,
->
firstDay
=
new
Date
(
'07/01/2016'
)
secondDay
=
new
Date
(
'08/01/2016'
)
difference
=
gl
.
utils
.
getDayDifference
(
firstDay
,
secondDay
)
expect
(
difference
).
toBe
(
31
)
it
'should return 365'
,
->
firstDay
=
new
Date
(
'07/02/2015'
)
secondDay
=
new
Date
(
'07/01/2016'
)
difference
=
gl
.
utils
.
getDayDifference
(
firstDay
,
secondDay
)
expect
(
difference
).
toBe
(
365
)
\ No newline at end of file
spec/javascripts/datetime_utility_spec.js.es6
0 → 100644
View file @
d8d699ff
//= require lib/utils/datetime_utility
(() => {
describe('Date time utils', () => {
describe('get day name', () => {
it('should return Sunday', () => {
const day = gl.utils.getDayName(new Date('07/17/2016'));
expect(day).toBe('Sunday');
});
it('should return Monday', () => {
const day = gl.utils.getDayName(new Date('07/18/2016'));
expect(day).toBe('Monday');
});
it('should return Tuesday', () => {
const day = gl.utils.getDayName(new Date('07/19/2016'));
expect(day).toBe('Tuesday');
});
it('should return Wednesday', () => {
const day = gl.utils.getDayName(new Date('07/20/2016'));
expect(day).toBe('Wednesday');
});
it('should return Thursday', () => {
const day = gl.utils.getDayName(new Date('07/21/2016'));
expect(day).toBe('Thursday');
});
it('should return Friday', () => {
const day = gl.utils.getDayName(new Date('07/22/2016'));
expect(day).toBe('Friday');
});
it('should return Saturday', () => {
const day = gl.utils.getDayName(new Date('07/23/2016'));
expect(day).toBe('Saturday');
});
});
describe('get day difference', () => {
it('should return 7', () => {
const firstDay = new Date('07/01/2016');
const secondDay = new Date('07/08/2016');
const difference = gl.utils.getDayDifference(firstDay, secondDay);
expect(difference).toBe(7);
});
it('should return 31', () => {
const firstDay = new Date('07/01/2016');
const secondDay = new Date('08/01/2016');
const difference = gl.utils.getDayDifference(firstDay, secondDay);
expect(difference).toBe(31);
});
it('should return 365', () => {
const firstDay = new Date('07/02/2015');
const secondDay = new Date('07/01/2016');
const difference = gl.utils.getDayDifference(firstDay, secondDay);
expect(difference).toBe(365);
});
});
});
})();
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