You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(persianTodayDateTemp[2]+6)%7 was chosen rather than simply (persianTodayDateTemp[2]-1) to avoid getting a possibly negative function argument on Sunday.
It seems to work for today, haven't yet tested it for other days though.
Alternatively, relying on the JS native i18n API, replacing the entire RHS with 'امروز، ' + (new Date).toLocaleDateString("fa-IR", {weekday: "long", year: "numeric", month: "long", day: "numeric"}).slice(0, -5), will also do the trick and be less of a hack.
The text was updated successfully, but these errors were encountered:
weekday of today in the footer is off by 1 day
I fixed it by changing line 331 from:
todayDateTimeString = 'امروز، ' + getPersianWeekDay(persianTodayDateTemp[2]) + ' ' + toPersianNumber(currentDayNumber) + ' ' + getPersianMonth(currentMonthNumber) + ' ' + toPersianNumber(currentYearNumber),
to
todayDateTimeString = 'امروز، ' + getPersianWeekDay((persianTodayDateTemp[2]+6)%7) + ' ' + toPersianNumber(currentDayNumber) + ' ' + getPersianMonth(currentMonthNumber) + ' ' + toPersianNumber(currentYearNumber),
(persianTodayDateTemp[2]+6)%7 was chosen rather than simply (persianTodayDateTemp[2]-1) to avoid getting a possibly negative function argument on Sunday.
It seems to work for today, haven't yet tested it for other days though.
Alternatively, relying on the JS native i18n API, replacing the entire RHS with 'امروز، ' + (new Date).toLocaleDateString("fa-IR", {weekday: "long", year: "numeric", month: "long", day: "numeric"}).slice(0, -5), will also do the trick and be less of a hack.
The text was updated successfully, but these errors were encountered: