From cd2db2d9c99e55c68806a9a80abc0f025e1b694f Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 08:49:18 +0000 Subject: [PATCH 1/2] feat: add DateTimePicker component --- .../veui/src/components/DateTimePicker.vue | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 packages/veui/src/components/DateTimePicker.vue diff --git a/packages/veui/src/components/DateTimePicker.vue b/packages/veui/src/components/DateTimePicker.vue new file mode 100644 index 000000000..b9f83c210 --- /dev/null +++ b/packages/veui/src/components/DateTimePicker.vue @@ -0,0 +1,120 @@ + + + + + From ab016094990b500558acfaca29a65505a5cda50c Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 08:53:54 +0000 Subject: [PATCH 2/2] feat: Updated packages/veui/src/components/DateTim --- packages/veui/src/components/DateTimePicker.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/veui/src/components/DateTimePicker.vue b/packages/veui/src/components/DateTimePicker.vue index b9f83c210..d91f27635 100644 --- a/packages/veui/src/components/DateTimePicker.vue +++ b/packages/veui/src/components/DateTimePicker.vue @@ -103,18 +103,24 @@ export default { this.realValue = null }, formatDateTime (value) { - // implement date time formatting + let dateData = toDateData(value) + return `${dateData.year}-${padStart(dateData.month, 2, '0')}-${padStart(dateData.day, 2, '0')} ${padStart(dateData.hours, 2, '0')}:${padStart(dateData.minutes, 2, '0')}` }, parseDateTime (value) { - // implement date time parsing + let [datePart, timePart] = value.split(' ') + let [year, month, day] = datePart.split('-').map(Number) + let [hours, minutes] = timePart.split(':').map(Number) + return add(startOf(new Date(year, month - 1, day), 'day'), { hours, minutes }) }, handleDropdownChange (index, value) { - // implement dropdown change handling + this.realValue = value } } }