update function to use local timezone and use original format
Signed-off-by: Rye Pasaporte <ryepassport@gmail.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/plugin-catalog-unprocessed-entities': patch
|
||||
---
|
||||
|
||||
Fixed the `convertTimeToLocalTimezone` function in the FailedEntities component to correctly parse ISO 8601 date strings.
|
||||
Fixed the `convertTimeToLocalTimezone` function in the FailedEntities component to correctly parse ISO 8601 date strings and set the timezone to the current local timezone.
|
||||
|
||||
@@ -94,12 +94,10 @@ const RenderErrorContext = ({
|
||||
*/
|
||||
const convertTimeToLocalTimezone = (strDateTime: string | Date) => {
|
||||
const dateTime = DateTime.fromISO(strDateTime.toLocaleString(), {
|
||||
zone: 'UTC',
|
||||
zone: DateTime.local().zoneName,
|
||||
});
|
||||
|
||||
const dateTimeLocalTz = dateTime.setZone(DateTime.local().zoneName);
|
||||
|
||||
return dateTimeLocalTz.toFormat('yyyy-MM-dd hh:mm:ss ZZZZ');
|
||||
return dateTime.toFormat('yyyy-MM-dd hh:mm:ss ZZZZ');
|
||||
};
|
||||
|
||||
export const FailedEntities = () => {
|
||||
|
||||
Reference in New Issue
Block a user