Ghost/core/server/models/base
Katharina Irrgang 3002747b68 Return dates from the database without milliseconds (#9054)
no issue

- we store dates without milliseconds in the database
- our test environment does not use our model layer to insert data, this is related to  https://github.com/TryGhost/Ghost/issues/7196
- so it can happen that the test env inserts unix timestamps instead of a formatted string
- e.g. adding data via the model layer (e.g. via the API) the format is always normalised to `YYYY-MM-DD HH:mm:ss`
- if we fetch the date from the database, we have a hook which sorts out knex returning different formats for dates
- this hook wraps the returned date into a UTC moment date, but adds the current milliseconds on top
- which can collide in tests when you have specific assertions
- use `startOf` to ignore milliseconds
- furthermore: remove the mentionings of `pg` (postgres)
2017-09-26 17:16:46 +01:00
..
index.js Return dates from the database without milliseconds (#9054) 2017-09-26 17:16:46 +01:00
listeners.js 🎨 do not run model listeners on import (#8720) 2017-07-21 09:58:58 +01:00
token.js 🐛 🎨 old accesstokens are not cleaned up (#8065) 2017-03-01 10:12:03 +00:00
utils.js 🙀 Image field naming & new img_url helper (#8364) 2017-04-24 18:21:47 +01:00