Skip to content

Commit

Permalink
fix(leav-ui): adapt datepicker to design system (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudAmsellem authored Aug 29, 2024
1 parent 90cf8d9 commit 44720ac
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 122 deletions.
3 changes: 3 additions & 0 deletions apps/core/src/domain/actions/formatDateAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default function (): IActionsListFunction<{localized: false; universal: f
const errors: IActionsListFunctionResult['errors'] = [];

const formattedValues = values.map(elementValue => {
if ('raw_value' in elementValue) {
elementValue.value = elementValue.raw_value;
}
if (elementValue.value === null) {
return elementValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export const getAntdFormInitialValues = (recordForm: IRecordForm) =>
acc[attribute.id] = Number(standardValue?.raw_value) ?? '';
}

if (attribute.format === AttributeFormat.date) {
acc[attribute.id] = standardValue?.raw_value ? dayjs.unix(Number(standardValue?.raw_value)) : '';
}

if (attribute.format === AttributeFormat.date_range) {
if (!standardValue?.raw_value) {
return acc;
Expand Down

This file was deleted.

Loading

0 comments on commit 44720ac

Please sign in to comment.