mirror of
https://github.com/nextcloud/server.git
synced 2026-03-29 22:03:27 -04:00
enh: rename to saturday sunday
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit c2dfc42899)
This commit is contained in:
parent
3248e3f961
commit
2139e33fb3
1 changed files with 7 additions and 7 deletions
|
|
@ -51,28 +51,28 @@ export const getDateTime = (dateTime: DateTimePreset): Date => {
|
|||
|
||||
[DateTimePreset.ThisWeekend]: () => {
|
||||
const today = moment()
|
||||
const weekendFirstDay = moment()
|
||||
const saturday = moment()
|
||||
.startOf('isoWeek')
|
||||
.add(5, 'day')
|
||||
.add(9, 'hour')
|
||||
const weekendSecondDay = moment()
|
||||
const sunday = moment()
|
||||
.startOf('isoWeek')
|
||||
.add(6, 'day')
|
||||
.add(9, 'hour')
|
||||
if (today.isSame(weekendFirstDay, 'date')) {
|
||||
return weekendFirstDay
|
||||
if (today.isSame(saturday, 'date')) {
|
||||
return saturday
|
||||
.add(1, 'day')
|
||||
.toDate()
|
||||
}
|
||||
if (today.isSame(weekendSecondDay, 'date')) {
|
||||
return weekendSecondDay
|
||||
if (today.isSame(sunday, 'date')) {
|
||||
return sunday
|
||||
.add(1, 'week')
|
||||
.startOf('isoWeek')
|
||||
.add(5, 'day')
|
||||
.add(9, 'hour')
|
||||
.toDate()
|
||||
}
|
||||
return weekendFirstDay.toDate()
|
||||
return saturday.toDate()
|
||||
},
|
||||
|
||||
[DateTimePreset.NextWeek]: () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue