mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-23 11:17:26 +02:00
Use locale to format dates and times (#123)
* Use deployment url in demo description. Close #131
This commit is contained in:
parent
8263926168
commit
8aec24308e
40 changed files with 1240 additions and 864 deletions
|
@ -24,6 +24,7 @@ interface HeadlessDatePickerOptions {
|
|||
date?: Date;
|
||||
selection?: Date[];
|
||||
onNavigationChange?: (date: Date) => void;
|
||||
weekStartsOn?: "monday" | "sunday";
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
|
@ -47,7 +48,9 @@ export const useHeadlessDatePicker = (
|
|||
const navigationDate = options?.date ?? localNavigationDate;
|
||||
|
||||
const firstDayOfMonth = startOfMonth(navigationDate);
|
||||
const firstDayOfFirstWeek = startOfWeek(firstDayOfMonth, { weekStartsOn: 1 });
|
||||
const firstDayOfFirstWeek = startOfWeek(firstDayOfMonth, {
|
||||
weekStartsOn: options?.weekStartsOn === "monday" ? 1 : 0,
|
||||
});
|
||||
|
||||
const currentMonth = getMonth(navigationDate);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue