mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 01:22:49 +00:00
feat(AmharicDatePicker): implement Amharic date picker component with calendar type switching and time input
This commit is contained in:
@@ -27,11 +27,10 @@ import {
|
||||
IconTrash,
|
||||
IconPlus,
|
||||
IconInfoCircle,
|
||||
IconCalendar,
|
||||
IconClipboardList,
|
||||
IconDetails,
|
||||
} from "@tabler/icons-react";
|
||||
import { notify, useErrorHandler, AdvancedTable, useServerTable, ModalFooter, type AdvancedColumn } from "@ema-platform/ui";
|
||||
import { notify, useErrorHandler, AdvancedTable, useServerTable, ModalFooter, AmharicDatePicker, type AdvancedColumn } from "@ema-platform/ui";
|
||||
import { useGetCertificationsQuery } from "../../certification/api/certification-api";
|
||||
import {
|
||||
useGetExamsQuery,
|
||||
@@ -194,13 +193,12 @@ function ExamForm({
|
||||
autosize
|
||||
minRows={2}
|
||||
/>
|
||||
<TextInput
|
||||
<AmharicDatePicker
|
||||
label={t("exam.form.examDate")}
|
||||
type="date"
|
||||
value={date}
|
||||
onChange={(e) => setDate(e.currentTarget.value)}
|
||||
onChange={setDate}
|
||||
dateFormat="date"
|
||||
size="sm"
|
||||
leftSection={<IconCalendar size={14} />}
|
||||
required
|
||||
/>
|
||||
<TextInput
|
||||
|
||||
@@ -47,7 +47,7 @@ import {
|
||||
type LicenseStatus,
|
||||
type QueueFilter,
|
||||
} from '@ema-platform/api';
|
||||
import { AdvancedTable, EmptyState, ErrorState, type AdvancedColumn } from '@ema-platform/ui';
|
||||
import { AdvancedTable, EmptyState, ErrorState, AmharicDatePicker, type AdvancedColumn } from '@ema-platform/ui';
|
||||
import { computeSla } from '../sla';
|
||||
import {
|
||||
DEFAULT_VIEW,
|
||||
@@ -496,17 +496,17 @@ export function LicenseQueuePage() {
|
||||
w={220}
|
||||
/>
|
||||
)}
|
||||
<TextInput
|
||||
type="date"
|
||||
<AmharicDatePicker
|
||||
label={t('queue.submittedFrom', 'Submitted from')}
|
||||
value={urlFilter.submittedFrom ?? ''}
|
||||
onChange={(e) => setFacet({ submittedFrom: e.currentTarget.value || undefined })}
|
||||
onChange={(v) => setFacet({ submittedFrom: v || undefined })}
|
||||
dateFormat="date"
|
||||
/>
|
||||
<TextInput
|
||||
type="date"
|
||||
<AmharicDatePicker
|
||||
label={t('queue.submittedTo', 'Submitted to')}
|
||||
value={urlFilter.submittedTo ?? ''}
|
||||
onChange={(e) => setFacet({ submittedTo: e.currentTarget.value || undefined })}
|
||||
onChange={(v) => setFacet({ submittedTo: v || undefined })}
|
||||
dateFormat="date"
|
||||
/>
|
||||
{hasFacets && (
|
||||
<Button
|
||||
|
||||
@@ -57,7 +57,7 @@ import {
|
||||
useScheduleInspectionMutation,
|
||||
type RemarkTargetType,
|
||||
} from '@ema-platform/api';
|
||||
import { ErrorState, ModalFooter } from '@ema-platform/ui';
|
||||
import { ErrorState, ModalFooter, AmharicDatePicker } from '@ema-platform/ui';
|
||||
import { usePermissions } from '@ema-platform/auth';
|
||||
import { useAppSelector } from '../../../store/hooks';
|
||||
import { DecisionBar } from '../components/DecisionBar';
|
||||
@@ -888,11 +888,11 @@ export function LicenseReviewPage() {
|
||||
title={t('review.actions.scheduleInspection', 'Schedule inspection')}
|
||||
>
|
||||
<Stack>
|
||||
<TextInput
|
||||
type="datetime-local"
|
||||
<AmharicDatePicker
|
||||
label={t('review.dateTime', 'Date and time')}
|
||||
value={inspectionDate}
|
||||
onChange={(e) => setInspectionDate(e.currentTarget.value)}
|
||||
onChange={setInspectionDate}
|
||||
withTime
|
||||
/>
|
||||
<ModalFooter>
|
||||
<Tooltip
|
||||
@@ -916,7 +916,7 @@ export function LicenseReviewPage() {
|
||||
run(async () => {
|
||||
await scheduleInspection({
|
||||
applicationId: id,
|
||||
scheduledDate: new Date(inspectionDate).toISOString(),
|
||||
scheduledDate: inspectionDate,
|
||||
}).unwrap();
|
||||
setInspectionOpen(false);
|
||||
}, t('review.done.scheduled', 'Inspection scheduled'))
|
||||
|
||||
@@ -102,6 +102,8 @@ export const am: Translations = {
|
||||
view: 'ይመልከቱ',
|
||||
toggleColumns: 'አምዶችን ቀያይር',
|
||||
noResult: 'ምንም አልተገኘም',
|
||||
switchCalendar: 'የቀን መቁጠሪያ ዓይነት ቀይር',
|
||||
time: 'ሰዓት',
|
||||
},
|
||||
|
||||
breadcrumbs: {
|
||||
|
||||
@@ -100,6 +100,8 @@ export const en = {
|
||||
view: 'View',
|
||||
toggleColumns: 'Toggle columns',
|
||||
noResult: 'No results',
|
||||
switchCalendar: 'Switch calendar type',
|
||||
time: 'Time',
|
||||
},
|
||||
|
||||
breadcrumbs: {
|
||||
|
||||
Reference in New Issue
Block a user