noppoMan / npdynamodb

A Node.js Simple Query Builder and ORM for AWS DynamoDB
112 stars 18 forks source link

The migration file is created with invalid datetime #20

Closed noppoMan closed 9 years ago

noppoMan commented 9 years ago

now.getDay() is terrible and following program doesn't consider timezone carefully.

var d = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDay(), now.getHours(), now.getMinutes(), now.getSeconds()));

var migrateFileParts = [
  d.getFullYear(),
  padDate(d.getMonth()+1),
  padDate(d.getDay()+1),
  padDate(d.getHours()),
  padDate(d.getMinutes()),
  padDate(d.getSeconds()),
  '_',
  name,
  '.js'
];
noppoMan commented 9 years ago

This will be fixed at v0.2.5.