diff --git a/packages/sdk-components-react/src/__generated__/time.props.ts b/packages/sdk-components-react/src/__generated__/time.props.ts index 54f507eff194..852f06d4a71f 100644 --- a/packages/sdk-components-react/src/__generated__/time.props.ts +++ b/packages/sdk-components-react/src/__generated__/time.props.ts @@ -215,13 +215,6 @@ export const props: Record = { defaultValue: "medium", options: ["full", "long", "medium", "short", "none"], }, - datetime: { - required: false, - control: "text", - type: "string", - defaultValue: "dateTime attribute is not set", - description: "Machine-readable value", - }, language: { required: false, control: "select", diff --git a/packages/sdk-components-react/src/time.tsx b/packages/sdk-components-react/src/time.tsx index 761ac784f58d..44df0070c87c 100644 --- a/packages/sdk-components-react/src/time.tsx +++ b/packages/sdk-components-react/src/time.tsx @@ -1,4 +1,4 @@ -import { forwardRef, type ElementRef } from "react"; +import { forwardRef, type ComponentProps, type ElementRef } from "react"; const languages = [ "af", @@ -345,8 +345,7 @@ const parseDate = (datetimeString: string) => { } }; -type TimeProps = { - datetime?: string; +type TimeProps = Pick, "dateTime"> & { language?: Language; country?: Country; dateStyle?: DateStyle; @@ -360,7 +359,8 @@ export const Time = forwardRef, TimeProps>( country = DEFAULT_COUNTRY, dateStyle = DEFAULT_DATE_STYLE, timeStyle = DEFAULT_TIME_STYLE, - datetime = INITIAL_DATE_STRING, + // native html attribute in react style + dateTime = INITIAL_DATE_STRING, ...props }, ref @@ -375,7 +375,7 @@ export const Time = forwardRef, TimeProps>( }; const datetimeString = - datetime === null ? INVALID_DATE_STRING : datetime.toString(); + dateTime === null ? INVALID_DATE_STRING : dateTime.toString(); const date = parseDate(datetimeString); let formattedDate = datetimeString;