mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed user import with no created_at date breaking graph
- users imported from CSV with no created_at date where having their created_at date being stored as an int rather than a datetime. - this was causing parsing issues with the graph so this commit fixes the formatting
This commit is contained in:
parent
1e5d201835
commit
da5586e5aa
1 changed files with 5 additions and 2 deletions
|
@ -248,10 +248,13 @@ function getMemberData({members, labels, importSetLabels, createdBy}) {
|
|||
|
||||
let createdAt = member.created_at === '' ? undefined : member.created_at;
|
||||
|
||||
// fixes a formatting issue where inserted dates are showing up as ints and not date times...
|
||||
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
|
||||
|
||||
if (createdAt) {
|
||||
createdAt = moment(createdAt).toDate();
|
||||
createdAt = moment(createdAt).format(dateFormat);
|
||||
} else {
|
||||
createdAt = new Date();
|
||||
createdAt = moment().format(dateFormat);
|
||||
}
|
||||
|
||||
const memberToInsert = {
|
||||
|
|
Loading…
Add table
Reference in a new issue