Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixed deprecation warning for moment().add().
* Fixed deprecation warning for moment().zone().
  • Loading branch information
Rui Marinho committed Feb 1, 2015
1 parent 8cea0fc commit f7f4ebb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sql-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ SqlString.formatNamedParameters = function(sql, values, timeZone, dialect) {
};

SqlString.dateToString = function(date, timeZone, dialect) {
date = moment(date).zone(timeZone);
date = moment(date).utcOffset(timeZone);

if (dialect === 'mysql' || dialect === 'mariadb') {
return date.format('YYYY-MM-DD HH:mm:ss');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"generic-pool": "2.1.1",
"inflection": "1.5.3",
"lodash": "~2.4.0",
"moment": "~2.8.0",
"moment": "^2.9.0",
"node-uuid": "~1.4.1",
"toposort-class": "~0.3.0",
"validator": "~3.22.1"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/model/findAll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {

it('sorts the results via a date column', function(done) {
var self = this;
self.User.create({username: 'user3', data: 'bar', theDate: moment().add('hours', 2).toDate()}).success(function() {
self.User.create({username: 'user3', data: 'bar', theDate: moment().add(2, 'hours').toDate()}).success(function() {
self.User.findAll({ order: [['theDate', 'DESC']] }).success(function(users) {
expect(users[0].id).to.be.above(users[2].id);
done();
Expand Down

0 comments on commit f7f4ebb

Please sign in to comment.