From 443f30dff508850cea8bfb4a1ed97678e4368661 Mon Sep 17 00:00:00 2001 From: fadhlu Date: Sun, 21 Mar 2021 18:23:16 +0800 Subject: [PATCH] Remove necessary package --- package.json | 2 - src/routes/calculator/_resin.svelte | 130 +++++++++++++++-------- src/routes/calculator/_resinTable.svelte | 22 +++- src/stores/time.js | 11 -- yarn.lock | 16 +-- 5 files changed, 102 insertions(+), 79 deletions(-) delete mode 100644 src/stores/time.js diff --git a/package.json b/package.json index 9bc703c4..12dd0ef6 100644 --- a/package.json +++ b/package.json @@ -39,11 +39,9 @@ "rollup-plugin-terser": "^7.0.0", "sapper": "^0.28.0", "svelte": "^3.17.3", - "svelte-countdown": "^1.0.0", "svelte-i18n": "^3.3.6", "svelte-preprocess": "^4.5.1", "svelte-simple-modal": "^0.6.1", - "svelte-time": "^0.3.0", "tailwindcss": "^1.9.5" } } diff --git a/src/routes/calculator/_resin.svelte b/src/routes/calculator/_resin.svelte index d519e142..28c648a2 100644 --- a/src/routes/calculator/_resin.svelte +++ b/src/routes/calculator/_resin.svelte @@ -1,12 +1,18 @@
@@ -78,10 +118,12 @@ placeholder={$t('calculator.resin.inputDesireResin')} />

- {$t('calculator.resin.currentTime')}: {new Intl.DateTimeFormat( - $t('calculator.resin.timeFormat'), - dateTimeOptions, - ).format($time)} + {$t('calculator.resin.currentTime')}: + {#if $t('calculator.resin.timeFormat') === 'en'} + {currentTime.locale('en').format('dddd HH:mm:ss')} + {:else} + {currentTime.locale('id').format('dddd HH:mm:ss')} + {/if}

@@ -90,38 +132,34 @@ > {#if !changed}
- - - {resinOutput} - - - - - - {originalResin.label} - - {originalResin.label} - - - - - - - {$t('calculator.resin.fullTime')}: - - - {new Intl.DateTimeFormat($t('calculator.resin.timeFormat'), dateTimeOptions).format(fullTime)} - ({remaining.hours != 0 ? `${remaining.hours} ${$t('calculator.resin.hours')}` : ''} - {remaining.minutes != 0 ? `${remaining.minutes} ${$t('calculator.resin.minutes')}` : ''} - {remaining.seconds != 0 ? `${remaining.seconds} ${$t('calculator.resin.seconds')}` : ''}) - - - + + + + +
+ + {$t('calculator.resin.fullTime')}: + {#if $t('calculator.resin.timeFormat') === 'en'} + {fullTime.locale('en').format('dddd HH:mm:ss')} ({fullTime.locale('en').fromNow()}) + {:else} + {fullTime.locale('id').format('dddd HH:mm:ss')} ({fullTime.locale('id').fromNow()}) + {/if} +
{/if}
+ + diff --git a/src/routes/calculator/_resinTable.svelte b/src/routes/calculator/_resinTable.svelte index 563acc46..f1433ba3 100644 --- a/src/routes/calculator/_resinTable.svelte +++ b/src/routes/calculator/_resinTable.svelte @@ -1,8 +1,13 @@