aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-31 13:27:38 +0100
committerJulien Dessaux2021-10-31 17:30:49 +0100
commitf1cd786cd745c6fa2a419648af968e9a66937ffb (patch)
tree383f8453d89572d9e0f243099091c95fe11903d9
parentReplaced uuid with the shorter nanoids (diff)
downloadshort-f1cd786cd745c6fa2a419648af968e9a66937ffb.tar.gz
short-f1cd786cd745c6fa2a419648af968e9a66937ffb.tar.bz2
short-f1cd786cd745c6fa2a419648af968e9a66937ffb.zip
Pretty print the creation and expiration dates
-rw-r--r--src/database.nim1
-rw-r--r--src/templates/short.html6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/database.nim b/src/database.nim
index a696d12..004d7c4 100644
--- a/src/database.nim
+++ b/src/database.nim
@@ -1,7 +1,6 @@
import std / [options, times]
import tiny_sqlite
-import nanoid
import dbUtils
diff --git a/src/templates/short.html b/src/templates/short.html
index 1f36fdf..fac811c 100644
--- a/src/templates/short.html
+++ b/src/templates/short.html
@@ -3,7 +3,9 @@
<h1>{{ $req.Title }}</h1>
<p><a href="{{ $req.Url }}">{{ $req.Url }}</a></p>
<p>
-Created on : {{ $req.Created }}<br>
-Expires on : {{ $req.Expires }}
+{% let created = req.Created.format("yyyy-MM-dd") %}
+{% let expires = req.Expires.format("yyyy-MM-dd") %}
+Created on : {{ $created }}<br>
+Expires on : {{ $expires }}
</p>
{% endblock %}