fix(bot): correct sleep-aware reminder wording

This commit is contained in:
2026-03-24 04:16:07 +04:00
parent 83ffd7df72
commit 782a8325ba
2 changed files with 14 additions and 10 deletions

View File

@@ -170,18 +170,11 @@ function relativeDayLabel(input: {
const tomorrow = nowDate.add({ days: 1 })
const dayAfterTomorrow = nowDate.add({ days: 2 })
const sleepAwareCurrentDate = input.now.hour <= 4 ? nowDate.subtract({ days: 1 }) : nowDate
const sleepAwareTomorrow = sleepAwareCurrentDate.add({ days: 1 })
const sleepAwareDayAfterTomorrow = sleepAwareCurrentDate.add({ days: 2 })
if (targetDate.equals(sleepAwareCurrentDate)) {
return input.locale === 'ru' ? 'сегодня' : 'today'
}
if (targetDate.equals(sleepAwareTomorrow)) {
if (input.now.hour <= 4 && targetDate.equals(nowDate) && input.target.hour <= 12) {
return input.locale === 'ru' ? 'завтра' : 'tomorrow'
}
if (targetDate.equals(sleepAwareDayAfterTomorrow)) {
return input.locale === 'ru' ? 'послезавтра' : 'the day after tomorrow'
if (targetDate.equals(nowDate)) {
return input.locale === 'ru' ? 'сегодня' : 'today'
}
if (targetDate.equals(tomorrow)) {
return input.locale === 'ru' ? 'завтра' : 'tomorrow'