Date picker for Date and DateTime field input (#4981)

- Implemented correct mask for Date and DateTime field in
InternalDatePicker
- Use only keyDown event and click outside in InternalDatePicker and
DateInput
- Refactored InternalDatePicker UI to have month and year displayed
- Fixed bug and synchronized date value between the different inputs
that can change it

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
This commit is contained in:
Lucas Bordeau
2024-04-16 16:58:08 +02:00
committed by GitHub
parent d63937ec6f
commit 19a3be7b1b
22 changed files with 261 additions and 122 deletions

View File

@ -0,0 +1,13 @@
import { formatToHumanReadableDateTime } from '~/utils';
import { EllipsisDisplay } from './EllipsisDisplay';
type DateTimeDisplayProps = {
value: Date | string | null | undefined;
};
export const DateTimeDisplay = ({ value }: DateTimeDisplayProps) => (
<EllipsisDisplay>
{value && formatToHumanReadableDateTime(value)}
</EllipsisDisplay>
);