Skip to content

Commit

Permalink
Merge pull request #10185 from nextcloud/backport/10177/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(MessageButtonsBar) - adjust predefined reminders conditions
  • Loading branch information
nickvergessen authored Aug 11, 2023
2 parents 03ce692 + a4c932b commit d4a56ff
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -554,21 +554,23 @@ export default {
reminderOptions() {
const currentDateTime = moment()
// Same day 18:00 PM (or hidden)
const laterTodayTime = (currentDateTime.hour() < 18)
// Same day 18:00 PM (hidden if after 17:00 PM now)
const laterTodayTime = (currentDateTime.hour() < 17)
? moment().hour(18)
: null
// Tomorrow 08:00 AM
const tomorrowTime = moment().add(1, 'days').hour(8)
// Saturday 08:00 AM (or hidden)
const thisWeekendTime = (currentDateTime.day() !== 6 && currentDateTime.day() !== 0)
// Saturday 08:00 AM (hidden if Friday, Saturday or Sunday now)
const thisWeekendTime = (currentDateTime.day() > 0 && currentDateTime.day() < 5)
? moment().day(6).hour(8)
: null
// Next Monday 08:00 AM
const nextWeekTime = moment().add(1, 'weeks').day(1).hour(8)
// Next Monday 08:00 AM (hidden if Sunday now)
const nextWeekTime = (currentDateTime.day() !== 0)
? moment().add(1, 'weeks').day(1).hour(8)
: null
return [
{
Expand Down

0 comments on commit d4a56ff

Please sign in to comment.