diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html
index e08ceb9..b51ddc6 100755
--- a/frontend/src/ketr-photos/ketr-photos.html
+++ b/frontend/src/ketr-photos/ketr-photos.html
@@ -333,9 +333,9 @@
+ min$="[[year]]-01-01"
+ max$="[[year]]-12-31"
+ date$="{{date}}">
Pick a date on the calendar to look back in time and see photos from that day.
On [[memoryDate]], there have been [[add(thumbnails.length,pendingPhotos.length)]] photos taken over [[years.length]] year(s).
@@ -469,6 +469,10 @@
Polymer({
is: "ketr-photos",
properties: {
+ year: {
+ type: String,
+ value: window.moment().format("YYYY")
+ },
actions: {
type: Array,
value: []
@@ -529,7 +533,7 @@
},
date: {
type: String,
- value: "2016-" + window.moment().format("MM-DD")
+ value: window.moment().format("YYYY-MM-DD")
}
},
@@ -585,15 +589,16 @@
},
isToday: function(date) {
- return this.date == "2016-" + window.moment().format("MM-DD");
+ return this.date == window.moment().format("YYYY-MM-DD");
},
gotoToday: function() {
- this.date = "2016-" + window.moment().format("MM-DD");
+ this.date = window.moment().format("YYYY-MM-DD");
+ console.log(this.date);
},
gotoRandomDay: function() {
- this.date = "2016-" + window.moment(Math.ceil(Math.random() * 365), "DDD").format("MM-DD");
+ this.date = window.moment().format("YYYY-") + window.moment(Math.ceil(Math.random() * 365), "DDD").format("MM-DD");
},
login: function(event) {
@@ -1470,7 +1475,7 @@
if (mode == "time") {
path = "";
} else if (mode == "memories") {
- path = "memories/" + (this.date.replace(/2016-/, "") || "");
+ path = "memories/" + (this.date.replace(this.year + "-", "") || "");
}
}
var username = this.user ? this.user.username : "";
@@ -1485,7 +1490,7 @@
if ((username != (this.user ? this.user.username : "")) ||
(mode != this.mode) ||
((mode == "albums") && (path != (this.path || ""))) ||
- ((mode == "memories") && (path != ("memories/" + (this.date.replace(/2016-/, "") || ""))))) {
+ ((mode == "memories") && (path != ("memories/" + (this.date.replace(this.year + "-", "") || ""))))) {
console.log("Skipping results for old query. Triggering re-fetch of photos for new path or mode.");
this._loadPhotos();
return;