feat: maintenance log (#170)

* remove repo for document tokens

* remove schema for doc tokens

* fix id template and generate cmd

* schema updates

* code gen

* bump dependencies

* fix broken migrations + add maintenance entry type

* spelling

* remove debug logger

* implement repository layer

* routes

* API client

* wip: maintenance log

* remove depreciated call
This commit is contained in:
Hayden 2022-12-09 20:57:57 -09:00 committed by GitHub
parent d6da63187b
commit 5bbb969763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 6320 additions and 4957 deletions

View file

@ -3,12 +3,37 @@
</template>
<script setup lang="ts">
enum DateTimeFormat {
RELATIVE = "relative",
LONG = "long",
SHORT = "short",
type DateTimeFormat = "relative" | "long" | "short" | "human";
function ordinalIndicator(num: number) {
if (num > 3 && num < 21) return "th";
switch (num % 10) {
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
}
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
const value = computed(() => {
if (!props.date) {
return "";
@ -24,12 +49,15 @@
}
switch (props.format) {
case DateTimeFormat.RELATIVE:
case "relative":
return useTimeAgo(dt).value + useDateFormat(dt, " (MM-DD-YYYY)").value;
case DateTimeFormat.LONG:
case "long":
return useDateFormat(dt, "MM-DD-YYYY (dddd)").value;
case DateTimeFormat.SHORT:
case "short":
return useDateFormat(dt, "MM-DD-YYYY").value;
case "human":
// January 1st, 2021
return `${months[dt.getMonth()]} ${dt.getDate()}${ordinalIndicator(dt.getDate())}, ${dt.getFullYear()}`;
default:
return "";
}