Skip to content

Commit

Permalink
Improved: util to include a method for parsing dateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Jan 26, 2024
1 parent bfa8b54 commit 224eafd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import saveAs from "file-saver";
import { toastController } from "@ionic/vue";
import Papa from "papaparse"
import { Group, Route, Rule } from "@/types";
import { DateTime } from "luxon";

// TODO Use separate files for specific utilities

Expand Down Expand Up @@ -124,4 +125,8 @@ const sortSequence = (sequence: Array<Group | Route | Rule>) => {
return sequence.sort((a, b) => a.sequenceNum - b.sequenceNum)
}

export { showToast, hasError , parseCsv , jsonToCsv, JsonToCsvOption, sortSequence }
const getTime = (time: any) => {
return time ? DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED) : '-';
}

export { getTime, showToast, hasError , parseCsv , jsonToCsv, JsonToCsvOption, sortSequence }

0 comments on commit 224eafd

Please sign in to comment.