-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
172 additions
and
93 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
4 changes: 2 additions & 2 deletions
4
frontend/src/components/UserPermissionHistoryTable/DateCol.vue
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
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,20 @@ | ||
import { DateTime } from "luxon"; | ||
import { TABLE_DATE_FORMAT } from "@/constants/DateFormats"; | ||
import { DATE_FORMAT, DATE_TIME_FORMAT } from "@/constants/DateFormats"; | ||
|
||
/** | ||
* Converts a UTC date-time string to the local user's time zone and formats it for display in a table. | ||
* | ||
* @param {string} utcDate - The UTC date-time string in ISO format (e.g., "2024-09-24T00:14:10.665421Z"). | ||
* @returns {string} The date-time formatted according to the table format (e.g., "Jan 09, 2023 | 03:09 PM"). | ||
*/ | ||
export const utcToTableLocalDateTime = (utcDate: string): string => | ||
DateTime.fromISO(utcDate).setZone("local").toFormat(TABLE_DATE_FORMAT); | ||
export const utcToLocalDateTime = (utcDate: string): string => | ||
DateTime.fromISO(utcDate).setZone("local").toFormat(DATE_TIME_FORMAT); | ||
|
||
/** | ||
* Converts a UTC date-time string to the local user's time zone and formats it for display in a table. | ||
* | ||
* @param {string} utcDate - The UTC date-time string in ISO format (e.g., "2024-09-24T00:14:10.665421Z"). | ||
* @returns {string} The date formatted according to the table format (e.g., "Jan 09, 2023"). | ||
*/ | ||
export const utcToLocalDate = (utcDate: string): string => | ||
DateTime.fromISO(utcDate).setZone("local").toFormat(DATE_FORMAT); |
Oops, something went wrong.