Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datepicker): datePicker now supports formatting of date #1314

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
small fix
  • Loading branch information
dhavalveera committed Jun 20, 2024
commit fe949e3df56e6466b3a7b60e149300bc65c3a8ad
3 changes: 1 addition & 2 deletions packages/ui/src/components/Datepicker/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const getFirstDayOfTheMonth = (date: Date, weekStart: WeekStart): Date =>
return addDays(firstDayOfMonth, -diff);
};

export const getWeekDays = (lang: string, weekStart: WeekStart): string[] => {
export const getWeekDays = (lang: string = "en-US", weekStart: WeekStart): string[] => {
const weekdays: string[] = [];
const date = new Date(0);
date.setDate(date.getDate() - date.getDay() + weekStart);
Expand Down Expand Up @@ -121,7 +121,6 @@ export const getFormattedDate = (
defaultOptions = options;
}
console.log(defaultOptions);


const getLocale =
language === "enUS" ? DateFNSLocale["enUS"] : Object.values(DateFNSLocale).find((l) => l.code === language);
Expand Down
Loading