mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Use iSameDate
This commit is contained in:
parent
7ad74b1398
commit
a7fc5536c5
@ -32,7 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { format } from 'date-fns'
|
||||
import { format, isSameDay } from 'date-fns'
|
||||
|
||||
export default {
|
||||
name: 'DateRange',
|
||||
@ -65,16 +65,8 @@ export default {
|
||||
return this.endDate ? new Date(this.endDate) : null
|
||||
},
|
||||
isSameDateButMayHaveTimeDifference() {
|
||||
return (
|
||||
!this.endDateAsDate ||
|
||||
(this.endDateAsDate.getYear() === this.startDateAsDate.getYear() &&
|
||||
this.endDateAsDate.getMonth() === this.startDateAsDate.getMonth() &&
|
||||
this.endDateAsDate.getDay() === this.startDateAsDate.getDay())
|
||||
)
|
||||
return !this.endDateAsDate || isSameDay(this.endDateAsDate, this.startDateAsDate)
|
||||
},
|
||||
// isSameYear() {
|
||||
// return this.isSameDate || (!this.endDateAsDate || this.endDateAsDate.getYear() === this.startDateAsDate.getYear())
|
||||
// },
|
||||
getStartDateString() {
|
||||
const isSameYear =
|
||||
this.isSameDateButMayHaveTimeDifference ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user