Correct behavior of date formatting
This commit is contained in:
parent
e23f609e7a
commit
1769d191d2
2 changed files with 3 additions and 3 deletions
|
@ -38,8 +38,8 @@ class FileObjectTransformer extends BaseDaemonTransformer
|
|||
'is_symlink' => Arr::get($item, 'symlink', false),
|
||||
'is_editable' => in_array(Arr::get($item, 'mime', ''), $this->editable),
|
||||
'mimetype' => Arr::get($item, 'mime'),
|
||||
'created_at' => Carbon::parse(explode(' ', Arr::get($item, 'created', ''))[0] ?? '')->toIso8601String(),
|
||||
'modified_at' => Carbon::parse(explode(' ', Arr::get($item, 'modified', ''))[0] ?? '')->toIso8601String(),
|
||||
'created_at' => Carbon::parse(Arr::get($item, 'created', ''))->toIso8601String(),
|
||||
'modified_at' => Carbon::parse(Arr::get($item, 'modified', ''))->toIso8601String(),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export default ({ file }: { file: FileObject }) => {
|
|||
{Math.abs(differenceInHours(file.modifiedAt, new Date())) > 48 ?
|
||||
format(file.modifiedAt, 'MMM Do, YYYY h:mma')
|
||||
:
|
||||
distanceInWordsToNow(file.modifiedAt, { includeSeconds: true })
|
||||
distanceInWordsToNow(file.modifiedAt, { addSuffix: true })
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue