[MM-54714] Change dnd status and remind to next morning 9 (#25472)

Этот коммит содержится в:
Sven Hüster
2023-12-20 14:45:55 +01:00
коммит произвёл GitHub
родитель 645d3a3b35
Коммит 2c6b5856a1
3 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@@ -63,8 +63,8 @@ function PostReminderSubmenu(props: Props) {
// add 2 hours in current time
endTime = currentDate.add(2, 'hours');
} else if (id === PostReminders.TOMORROW) {
// add one day in current date
endTime = currentDate.add(1, 'day');
// set to next day 9 in the morning
endTime = currentDate.add(1, 'day').set({hour: 9, minute: 0});
}
dispatch(addPostReminder(props.userId, props.post.id, toUTCUnix(endTime.toDate())));
@@ -112,7 +112,7 @@ function PostReminderSubmenu(props: Props) {
let trailingElements = null;
if (postReminder === PostReminders.TOMORROW) {
const tomorrow = getCurrentMomentForTimezone(props.timezone).add(1, 'day').toDate();
const tomorrow = getCurrentMomentForTimezone(props.timezone).add(1, 'day').set({hour: 9, minute: 0}).toDate();
trailingElements = (
<span className={`postReminder-${postReminder}_timestamp`}>

Просмотреть файл

@@ -152,14 +152,14 @@ exports[`components/StatusDropdown should match snapshot in default state 1`] =
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -467,14 +467,14 @@ exports[`components/StatusDropdown should match snapshot with custom status and
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -734,14 +734,14 @@ exports[`components/StatusDropdown should match snapshot with custom status enab
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -1001,14 +1001,14 @@ exports[`components/StatusDropdown should match snapshot with custom status expi
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -1269,14 +1269,14 @@ exports[`components/StatusDropdown should match snapshot with custom status puls
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -1511,14 +1511,14 @@ exports[`components/StatusDropdown should match snapshot with profile picture UR
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -1745,14 +1745,14 @@ exports[`components/StatusDropdown should match snapshot with status dropdown op
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -2012,14 +2012,14 @@ exports[`components/StatusDropdown should not show clear status button when cust
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,
@@ -2327,14 +2327,14 @@ exports[`components/StatusDropdown should show clear status button when custom s
className="dndTime-tomorrow_timestamp"
>
<FormattedDate
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
weekday="short"
/>
,
<FormattedTime
hour12={true}
timeStyle="short"
value={2021-11-03T22:48:57.000Z}
value={2021-11-03T09:00:57.000Z}
/>
</span>
</React.Fragment>,

Просмотреть файл

@@ -150,8 +150,8 @@ export class StatusDropdown extends React.PureComponent<Props, State> {
endTime = currentDate.add(2, 'hours');
break;
case 3:
// add one day in current date
endTime = currentDate.add(1, 'day');
// set to next day 9 in the morning
endTime = currentDate.add(1, 'day').set({hour: 9, minute: 0});
break;
}
@@ -374,7 +374,7 @@ export class StatusDropdown extends React.PureComponent<Props, State> {
this.dndTimes.map(({id, label, labelDefault}, index) => {
let text: React.ReactNode = localizeMessage(label, labelDefault);
if (index === 3) {
const tomorrow = getCurrentMomentForTimezone(this.props.timezone).add(1, 'day').toDate();
const tomorrow = getCurrentMomentForTimezone(this.props.timezone).add(1, 'day').set({hour: 9, minute: 0}).toDate();
text = (
<>
{text}