mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
21 lines
541 B
PHP
21 lines
541 B
PHP
<time x-data="timestamp"
|
|
x-effect="setNaturalDiff(new Date('{{ $carbon->toIso8601String() }}'), $store.time.now)"
|
|
class="timestamp"
|
|
datetime="{{ $carbon }}"
|
|
title="{{ $carbon->toDayDateTimeString() }}">
|
|
<span x-text="naturalDiff"></span>
|
|
</time>
|
|
|
|
@script
|
|
<script type="module">
|
|
Alpine.data('timestamp', () => {
|
|
return {
|
|
naturalDiff: '',
|
|
setNaturalDiff(then, now) {
|
|
this.naturalDiff = dateFormatDistance(then, $store.time.now, { addSuffix: true });
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
@endscript
|