Skip to content

Commit

Permalink
Fixed issue when not user format locale was used for formatting and f…
Browse files Browse the repository at this point in the history
…ixed input's style
  • Loading branch information
Explicit12 committed Jan 22, 2025
1 parent a31ad6d commit 58e508f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/ui.form-date-picker-range/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export default /*tw*/ {
},
rangeInputFirst: {
base: "{UInput} {>rangeInput}",
wrapper: "rounded-r-none",
wrapper: "!rounded-r-none",
},
rangeInputLast: {
base: "{UInput} {>rangeInput}",
wrapper: "rounded-l-none",
wrapper: "!rounded-l-none",
},
rangeInputError: "text-xs font-normal leading-none mt-2 text-center text-red-500",
datepickerCalendar: {
Expand Down
10 changes: 5 additions & 5 deletions src/ui.form-date-picker-range/useUserFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ export function useUserFormat(
const fromTitle = from ? formatDate(from, fromFormat, userFormatLocale.value) : "";
const toTitle = to ? formatDate(to, userDateFormat, userFormatLocale.value) : "";

title = `${fromTitle}${toTitle}`;
title = `${fromTitle.trim()}${toTitle.trim()}`;
}

if (isPeriod.value.month) {
title = formatDate(from, "F Y", locale.value);
title = formatDate(from, "F Y", userFormatLocale.value);
}

if (isPeriod.value.quarter || isPeriod.value.year) {
const fromFormat = userDateFormat.replace(/[Yy]/g, "");

const fromTitle = from ? formatDate(from, fromFormat, locale.value) : "";
const toTitle = to ? formatDate(to, userDateFormat, locale.value) : "";
const fromTitle = from ? formatDate(from, fromFormat, userFormatLocale.value) : "";
const toTitle = to ? formatDate(to, userDateFormat, userFormatLocale.value) : "";

title = `${fromTitle}${toTitle}`;
title = `${fromTitle.trim()}${toTitle.trim()}`;
}

return title;
Expand Down

0 comments on commit 58e508f

Please sign in to comment.