Compare commits

...

17 Commits

Author SHA1 Message Date
kodiakhq[bot] a7e90f8942
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 13:48:53 +00:00
kodiakhq[bot] b2cc259634
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 11:34:21 +00:00
kodiakhq[bot] 053cf56865
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 11:18:42 +00:00
kodiakhq[bot] c5adc70525
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 08:50:44 +00:00
kodiakhq[bot] 736f03599d
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 04:22:56 +00:00
kodiakhq[bot] 951504f007
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 02:51:08 +00:00
kodiakhq[bot] 23aec67824
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 02:42:04 +00:00
kodiakhq[bot] 1aab1d445f
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 02:14:53 +00:00
kodiakhq[bot] 738767e2db
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-26 00:28:51 +00:00
kodiakhq[bot] fc9202d247
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 23:28:39 +00:00
kodiakhq[bot] ed7dd721c0
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 22:22:59 +00:00
kodiakhq[bot] 5f0552b961
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 20:20:38 +00:00
kodiakhq[bot] 8f92f07d79
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 18:32:39 +00:00
kodiakhq[bot] a0b54a2a22
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 17:04:32 +00:00
kodiakhq[bot] a1b73b3c16
Merge branch 'main' into fix/2570-adds-saturday-first-day 2022-04-25 15:52:47 +00:00
Agusti Fernandez Pardo 28337dc342 fix: adds support in date picker for saturday as start of week 2022-04-25 05:04:40 +02:00
Agusti Fernandez Pardo 00b0d78e11 Fix: adds saturday as option for first day of week 2022-04-25 04:50:55 +02:00
2 changed files with 11 additions and 2 deletions

View File

@ -169,7 +169,10 @@ function DatePicker({
weekdayOfFirst -= 1;
if (weekdayOfFirst < 0) weekdayOfFirst = 6;
}
if (weekStart === "Saturday") {
weekdayOfFirst += 1;
if (weekdayOfFirst < 0) weekdayOfFirst = 5;
}
const days = Array(weekdayOfFirst).fill(null);
const isDisabledMemoized = isDisabledRef.current;
@ -259,7 +262,12 @@ function DatePicker({
</div>
</div>
<div className="border-bookinglightest grid grid-cols-7 gap-4 border-t border-b text-center dark:border-gray-800 sm:border-0">
{weekdayNames(i18n.language, weekStart === "Sunday" ? 0 : 1, "short").map((weekDay) => (
{weekdayNames(
i18n.language,
// @note: Double ternary operator to support also Saturday () as start of week
weekStart === "Sunday" ? 0 : weekStart === "Monday" ? 1 : 6,
"short"
).map((weekDay) => (
<div key={weekDay} className="text-bookinglight my-4 text-xs uppercase tracking-widest">
{weekDay}
</div>

View File

@ -359,6 +359,7 @@ function SettingsView(props: ComponentProps<typeof Settings> & { localeProp: str
options={[
{ value: "Sunday", label: nameOfDay(props.localeProp, 0) },
{ value: "Monday", label: nameOfDay(props.localeProp, 1) },
{ value: "Saturday", label: nameOfDay(props.localeProp, 6) },
]}
/>
</div>