fix(_createdAt/_updatedAt): fields are now ISO format

This commit is contained in:
Philipp Kunz 2024-04-15 14:26:21 +02:00
parent 162265f353
commit 73a11370b6
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartdata', name: '@push.rocks/smartdata',
version: '5.1.1', version: '5.1.2',
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.' description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
} }

View File

@ -192,13 +192,13 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
* updated from db in any case where doc comes from db * updated from db in any case where doc comes from db
*/ */
@svDb() @svDb()
_createdAt: number = Date.now(); _createdAt: string = (new Date()).toISOString();
/** /**
* will be updated everytime the doc is saved * will be updated everytime the doc is saved
*/ */
@svDb() @svDb()
_updatedAt: number = Date.now(); _updatedAt: string = (new Date()).toISOString();
/** /**
* unique indexes * unique indexes
@ -234,7 +234,7 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
const self: any = this; const self: any = this;
let dbResult: any; let dbResult: any;
this._updatedAt = Date.now(); this._updatedAt = (new Date()).toISOString();
switch (this.creationStatus) { switch (this.creationStatus) {
case 'db': case 'db':