From e628d345ca0a01046803da80f8819545a0a7403e Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sun, 23 Jul 2023 14:52:22 +1200 Subject: [PATCH] Reduce escaping of characters --- EditSet.tsx | 2 +- StartPlan.tsx | 2 +- ViewGraph.tsx | 4 ++-- db.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/EditSet.tsx b/EditSet.tsx index de09686..4c21b28 100644 --- a/EditSet.tsx +++ b/EditSet.tsx @@ -70,7 +70,7 @@ export default function EditSet() { value.weight > set.weight || (value.reps > set.reps && value.weight === set.weight) ) { - toast('Great work King! That\'s a new record.') + toast("Great work King! That's a new record.") } }, [startTimer, set, settings], diff --git a/StartPlan.tsx b/StartPlan.tsx index dc38790..1323ed4 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -107,7 +107,7 @@ export default function StartPlan() { settings.notify && (+weight > best.weight || (+reps > best.reps && +weight === best.weight)) ) { - toast('Great work King! That\'s a new record.') + toast("Great work King! That's a new record.") } if (!settings.alarm) return const milliseconds = Number(best.minutes) * 60 * 1000 + diff --git a/ViewGraph.tsx b/ViewGraph.tsx index 34be4aa..fcdb82c 100644 --- a/ViewGraph.tsx +++ b/ViewGraph.tsx @@ -32,11 +32,11 @@ export default function ViewGraph() { if (period === Periods.Yearly) group = '%Y-%m' const builder = setRepo .createQueryBuilder() - .select('STRFTIME(\'%Y-%m-%d\', created)', 'created') + .select("STRFTIME('%Y-%m-%d', created)", 'created') .addSelect('unit') .where('name = :name', { name: params.best.name }) .andWhere('NOT hidden') - .andWhere('DATE(created) >= DATE(\'now\', \'weekday 0\', :difference)', { + .andWhere("DATE(created) >= DATE('now', 'weekday 0', :difference)", { difference, }) .groupBy('name') diff --git a/db.ts b/db.ts index 066baaf..75628ba 100644 --- a/db.ts +++ b/db.ts @@ -9,7 +9,7 @@ export const settingsRepo = AppDataSource.manager.getRepository(Settings) export const getNow = async (): Promise => { const query = await AppDataSource.manager.query( - 'SELECT STRFTIME(\'%Y-%m-%dT%H:%M:%S\',\'now\',\'localtime\') AS now', + "SELECT STRFTIME('%Y-%m-%dT%H:%M:%S','now','localtime') AS now", ) return query[0].now }