From 34f9cb1de6d913514689a9723d4a8f66779c0ac9 Mon Sep 17 00:00:00 2001 From: Abscissa Date: Sun, 3 Jun 2012 00:47:48 -0400 Subject: [PATCH 1/2] Works without -d --- web.d | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web.d b/web.d index e765a4a..0c41e10 100644 --- a/web.d +++ b/web.d @@ -2664,13 +2664,12 @@ immutable(string[]) weekdayNames = [ // this might be temporary struct TemplateFilters { string date(string replacement, string[], in Element, string) { - auto date = to!long(replacement); - - import std.date; - - auto day = dateFromTime(date); - auto year = yearFromTime(date); - auto month = monthNames[monthFromTime(date)]; + auto dateTicks = to!time_t(replacement); + auto date = SysTime( unixTimeToStdTime(dateTicks/1_000) ); + + auto day = date.day; + auto year = date.year; + auto month = monthNames[date.month]; replacement = format("%s %d, %d", month, day, year); return replacement; From b0603a0fe8fbc3fe4f39496c22f2422f2ee324b7 Mon Sep 17 00:00:00 2001 From: Abscissa Date: Sun, 3 Jun 2012 00:51:34 -0400 Subject: [PATCH 2/2] Fixed warnings. --- web.d | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web.d b/web.d index 0c41e10..eef6b20 100644 --- a/web.d +++ b/web.d @@ -1518,7 +1518,7 @@ Form createAutomaticForm(Document document, string action, in Parameter[] parame } count++; - }; + } auto fmt = Element.make("select"); fmt.name = "format"; @@ -2161,7 +2161,6 @@ string formatAs(T, R)(T ret, string format, R api = null, JSONValue* returnValue else goto badType; +/ goto badType; // FIXME - break; case "json": assert(returnValue !is null); *returnValue = toJsonValue!(typeof(ret), R)(ret, formatJsonToStringAs, api);