2019-12-14 18:36:01 +00:00
|
|
|
<template>
|
2022-04-01 15:29:03 +00:00
|
|
|
<div
|
|
|
|
class="date--separator"
|
|
|
|
:class="$dm('text-slate-700', 'dark:text-slate-200')"
|
|
|
|
>
|
2020-12-24 13:23:47 +00:00
|
|
|
{{ formattedDate }}
|
2019-12-14 18:36:01 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-24 13:23:47 +00:00
|
|
|
import { formatDate } from 'shared/helpers/DateHelper';
|
2022-04-01 15:29:03 +00:00
|
|
|
import darkModeMixin from 'widget/mixins/darkModeMixin.js';
|
|
|
|
|
2019-12-14 18:36:01 +00:00
|
|
|
export default {
|
2022-04-01 15:29:03 +00:00
|
|
|
mixins: [darkModeMixin],
|
2019-12-14 18:36:01 +00:00
|
|
|
props: {
|
|
|
|
date: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2020-12-24 13:23:47 +00:00
|
|
|
computed: {
|
|
|
|
formattedDate() {
|
|
|
|
return formatDate({
|
|
|
|
date: this.date,
|
|
|
|
todayText: this.$t('TODAY'),
|
|
|
|
yesterdayText: this.$t('YESTERDAY'),
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
2019-12-14 18:36:01 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~widget/assets/scss/variables';
|
|
|
|
|
|
|
|
.date--separator {
|
|
|
|
font-size: $font-size-default;
|
|
|
|
height: 50px;
|
|
|
|
line-height: 50px;
|
|
|
|
position: relative;
|
|
|
|
text-align: center;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date--separator::before,
|
|
|
|
.date--separator::after {
|
|
|
|
background-color: $color-border;
|
|
|
|
content: '';
|
|
|
|
height: 1px;
|
|
|
|
position: absolute;
|
|
|
|
top: 24px;
|
|
|
|
width: calc((100% - 120px) / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
.date--separator::before {
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date--separator::after {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
</style>
|