Use moment for better postgres timestamp strings#710
Use moment for better postgres timestamp strings#710durango merged 2 commits intosequelize:masterfrom
Conversation
|
The build failed because you forgot to update the package.json, BUT I'm incredibly on the fence with including a library such as moment into SequelizeJS (I've thought about this before) the reason why is because momentjs is such a big library to include and the less dependencies the better. @sdepold @mickhansen @janmeier any thoughts on dependencies / momentjs specifically? |
|
Moment's already in the package.json in the master HEAD https://github.com/sequelize/sequelize/blob/master/package.json#L39. The same adjustment could be done with printf, but the library's already included, presumably because date formatting is such a tricky problem that it's good to outsource it to a dedicated library. |
|
It looks like some jasmine tests are failing due to the different timezone format that moment uses vs. the previous manual formatting. The moment format better matches postgres' internal format; I'll update the tests and amend the pull. |
|
Ah fair point, I didn't even realize we had that in our dependencies already. It seems like your tests are fialing because of th enew millisecond addition :) |
|
Ah you already commented! Yeah update and I'll merge :) |
|
Actually, let me ask a few people if this should be in the 2.0 branch (since it actually changes an outcome for sequelizejs.. it shouldn't be a problem, but what if someone relied the 0Z for their dates in production? Basically, just trying to get the input of one more person). |
Use moment for better postgres timestamp strings
This patch fixes a bug where milliseconds <100 on timestamps were not being correctly zero-padded. For example, March 1, 2013 3:20 p.m. and 53 milliseconds was being stringified as "2013-03-01 15:20:00.53" rather than "2013-03-01 15:20:00.053"