Skip to content

Commit 482d377

Browse files
committed
fix: set correct date time property in Time component
All html attributes all converted to react style though in case of Time property was converted. The easiest solution is to rename the actual property to accept converted time.
1 parent 7745c5f commit 482d377

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/sdk-components-react/src/__generated__/time.props.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk-components-react/src/time.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ const parseDate = (datetimeString: string) => {
346346
};
347347

348348
type TimeProps = {
349-
datetime?: string;
349+
dateTime?: string;
350350
language?: Language;
351351
country?: Country;
352352
dateStyle?: DateStyle;
@@ -360,7 +360,7 @@ export const Time = forwardRef<ElementRef<"time">, TimeProps>(
360360
country = DEFAULT_COUNTRY,
361361
dateStyle = DEFAULT_DATE_STYLE,
362362
timeStyle = DEFAULT_TIME_STYLE,
363-
datetime = INITIAL_DATE_STRING,
363+
dateTime = INITIAL_DATE_STRING,
364364
...props
365365
},
366366
ref
@@ -375,7 +375,7 @@ export const Time = forwardRef<ElementRef<"time">, TimeProps>(
375375
};
376376

377377
const datetimeString =
378-
datetime === null ? INVALID_DATE_STRING : datetime.toString();
378+
dateTime === null ? INVALID_DATE_STRING : dateTime.toString();
379379

380380
const date = parseDate(datetimeString);
381381
let formattedDate = datetimeString;

packages/sdk-components-react/src/time.ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ export const meta: WsComponentMeta = {
2323

2424
export const propsMeta: WsComponentPropsMeta = {
2525
props,
26-
initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"],
26+
initialProps: ["dateTime", "language", "country", "dateStyle", "timeStyle"],
2727
};

0 commit comments

Comments
 (0)