From 8943b3423f70df83b3b941fd5242c7bd97898d90 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 31 Mar 2017 17:49:51 +0200
Subject: mod_storage_internal: Add the dates method

---
 plugins/mod_storage_internal.lua | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index c1e460eb..09760838 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -120,6 +120,12 @@ function archive:find(username, query)
 	end, count;
 end
 
+function archive:dates(username)
+	local items, err = datamanager.list_load(username, host, self.store);
+	if not items then return items, err; end
+	return array(items):pluck("when"):map(datetime.date):unique();
+end
+
 function archive:delete(username, query)
 	if not query or next(query) == nil then
 		return datamanager.list_store(username, host, self.store, nil);
-- 
cgit v1.2.3