]> Entropealabs - photography.git/commitdiff
reverse sort order, sort tags
authorChristopher Coté <chris@entropealabs.com>
Mon, 10 Jan 2022 17:21:22 +0000 (12:21 -0500)
committerChristopher Coté <chris@entropealabs.com>
Mon, 10 Jan 2022 17:21:22 +0000 (12:21 -0500)
src/index.js

index 0819901e2cccb3e966b5560a5e84aee7b76c8173..323060377717baf436f076e253ddc414563d467f 100644 (file)
@@ -25,7 +25,7 @@ function get_metadata(){
 
 function process_media(items){
   items.forEach(i => i.datetime = new Date(i.datetime));
-  items.sort((a, b) => b.datetime < a.datetime);
+  items.sort((a, b) => a.datetime < b.datetime);
   items.forEach(i => {
     i.tags.forEach(t => {
       tags[t] = tags[t] ? tags[t] : [];
@@ -57,6 +57,7 @@ function show_tag(tag) {
 function create_tags(){
   let p = document.getElementById("tags");
   let ta = Object.keys(tags);
+  ta.sort();
   ta.forEach(t => {
     let ta = tag(t);
     p.appendChild(ta);