mirror of
https://github.com/flextype/flextype.git
synced 2025-08-10 23:24:04 +02:00
fix(fields): fix issues with strtotime() function.
This commit is contained in:
@@ -11,7 +11,7 @@ use Atomastic\Strings\Strings;
|
||||
|
||||
if (flextype('registry')->get('flextype.settings.entries.fields.created_at.enabled')) {
|
||||
flextype('emitter')->addListener('onEntryAfterInitialized', static function (): void {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.created_at') == null) {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.created_at') === null) {
|
||||
flextype('entries')->setStorage('fetch_single.data.created_at', (int) flextype('filesystem')->file(flextype('entries')->getFileLocation(flextype('entries')->getStorage('fetch_single.id')))->lastModified());
|
||||
} else {
|
||||
flextype('entries')->setStorage('fetch_single.data.created_at', (int) strtotime((string) flextype('entries')->getStorage('fetch_single.data.created_at')));
|
||||
@@ -19,7 +19,7 @@ if (flextype('registry')->get('flextype.settings.entries.fields.created_at.enabl
|
||||
});
|
||||
|
||||
flextype('emitter')->addListener('onEntryCreate', static function (): void {
|
||||
if (flextype('entries')->getStorage('create.data.created_at') == null) {
|
||||
if (flextype('entries')->getStorage('create.data.created_at') === null) {
|
||||
flextype('entries')->setStorage('create.data.created_at', date(flextype('registry')->get('flextype.settings.date_format'), time()));
|
||||
}
|
||||
});
|
||||
|
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
|
||||
if (flextype('registry')->get('flextype.settings.entries.fields.modified_at.enabled')) {
|
||||
flextype('emitter')->addListener('onEntryAfterInitialized', static function (): void {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.modified_at') == null) {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.modified_at') === null) {
|
||||
flextype('entries')->setStorage('fetch_single.data.modified_at', (int) flextype('filesystem')->file(flextype('entries')->getFileLocation(flextype('entries')->getStorage('fetch_single.id')))->lastModified());
|
||||
}
|
||||
});
|
||||
|
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
|
||||
if (flextype('registry')->get('flextype.settings.entries.fields.published_at.enabled')) {
|
||||
flextype('emitter')->addListener('onEntryAfterInitialized', static function (): void {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.published_at') == null) {
|
||||
if (flextype('entries')->getStorage('fetch_single.data.published_at') === null) {
|
||||
flextype('entries')->setStorage('fetch_single.data.published_at', (int) flextype('filesytem')->file(flextype('entries')->getFileLocation(flextype('entries')->getStorage('fetch_single.id')))->lastModified());
|
||||
} else {
|
||||
flextype('entries')->setStorage('fetch_single.data.published_at', (int) strtotime((string) flextype('entries')->getStorage('fetch_single.data.published_at')));
|
||||
@@ -17,7 +17,7 @@ if (flextype('registry')->get('flextype.settings.entries.fields.published_at.ena
|
||||
});
|
||||
|
||||
flextype('emitter')->addListener('onEntryCreate', static function (): void {
|
||||
if (flextype('entries')->getStorage('create.data.published_at') == null) {
|
||||
if (flextype('entries')->getStorage('create.data.published_at') === null) {
|
||||
flextype('entries')->setStorage('create.data.published_at', date(flextype('registry')->get('flextype.settings.date_format'), time()));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user