Skip to content

Commit

Permalink
test for issue moment#3132 - TODO: make it less issue specific
Browse files Browse the repository at this point in the history
  • Loading branch information
G1NA committed May 23, 2017
1 parent 72f56ce commit c95c230
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/moment/start_end_of.js
Expand Up @@ -189,6 +189,22 @@ test('end of day', function (assert) {
assert.equal(m.milliseconds(), 999, 'set the seconds');
});

test('end of day - testing issue #3132', function (assert) {
var d = moment.tz("2016-10-16","America/Sao_Paulo");
var m = d.endOf('day').format("YYYY-MM-DD HH:mm:ss"),
ms = d.endOf('days').format("YYYY-MM-DD HH:mm:ss"),
ma = d.endOf('d').format("YYYY-MM-DD HH:mm:ss");
assert.equal(+m, +ms, 'Plural or singular should work');
assert.equal(+m, +ma, 'Full or abbreviated should work');
assert.equal(m.year(), 2016, 'keep the year');
assert.equal(m.month(), 10, 'keep the month');
assert.equal(m.date(), 16, 'keep the day');
assert.equal(m.hours(), 23, 'set the hours');
assert.equal(m.minutes(), 59, 'set the minutes');
assert.equal(m.seconds(), 59, 'set the seconds');
assert.equal(m.milliseconds(), 999, 'set the seconds');
});

test('start of date', function (assert) {
var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('date'),
ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('dates');
Expand Down

0 comments on commit c95c230

Please sign in to comment.