-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed date-fns and date-fns-tz from all autocomponents
- Loading branch information
Showing
7 changed files
with
396 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/react/src/auto/polaris/inputs/PolarisAutoTimePicker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
packages/react/src/auto/polaris/tableCells/PolarisAutoTableDateTimeCell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { format } from "date-fns"; | ||
import React from "react"; | ||
import { formatLongDateTimeString } from "../../../utils.js"; | ||
import { PolarisAutoTableTextCell } from "./PolarisAutoTableTextCell.js"; | ||
|
||
export const PolarisAutoTableDateTimeCell = (props: { value: Date; includeTime: boolean }) => { | ||
const { value, includeTime } = props; | ||
|
||
const timeFormat = includeTime ? "LLL d, y K:mm a" : "LLL d, y"; | ||
|
||
return value instanceof Date ? <PolarisAutoTableTextCell value={format(value, timeFormat)} /> : null; | ||
return value instanceof Date ? <PolarisAutoTableTextCell value={formatLongDateTimeString(value, includeTime)} /> : null; | ||
}; |
Oops, something went wrong.