aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-04-25 21:45:20 -0400
committerbobzel <zzzman@gmail.com>2022-04-25 21:45:20 -0400
commit5f297a17b38bdcd4d3928137daacf14fe2fbec9f (patch)
tree674a4093ecb98cb8921a62133ae34bff66431995 /src/Utils.ts
parentcb59842fcb79af7ef72443e08c6a479c3f0af343 (diff)
put snapshot dash in novice mode. fixed undo for snapshot/new dashboard. changed titling of snapshots to use {#}. no current UI for cloning dashboards.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index d1d400de7..38eb51529 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -399,6 +399,12 @@ export function timenow() {
return now.toLocaleDateString() + ' ' + h + ':' + m + ' ' + ampm;
}
+export function incrementTitleCopy(title: string) {
+ const numstr = title.match(/.*(\{([0-9]*)\})+/);
+ const copyNumStr = `{${1 + (numstr ? (+numstr[2]) : 0)}}`;
+ return (numstr ? title.replace(numstr[1], "") : title) + copyNumStr;
+}
+
export function formatTime(time: number) {
time = Math.round(time);
const hours = Math.floor(time / 60 / 60);