diff options
author | David A. Madore <david+git@madore.org> | 2014-10-09 17:54:26 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2014-10-09 17:54:26 +0200 |
commit | 0abe0182eda83e0b4e41b98a5b22071d90b46c1a (patch) | |
tree | 0111bf2b35bb3fb62bbe502cd4a191ba22a8ab2f /org/madore/damlengine/TodoWeblogSelectionElement.java | |
parent | 1fa9c99c4c069ef395bd9562c2aa817bfc656f09 (diff) | |
parent | 8ed1ac19770dca2b5c37c529fe4420068e107f77 (diff) | |
download | damlengine-0abe0182eda83e0b4e41b98a5b22071d90b46c1a.tar.gz damlengine-0abe0182eda83e0b4e41b98a5b22071d90b46c1a.tar.bz2 damlengine-0abe0182eda83e0b4e41b98a5b22071d90b46c1a.zip |
Merge branch 'master' into servlet
Diffstat (limited to 'org/madore/damlengine/TodoWeblogSelectionElement.java')
-rw-r--r-- | org/madore/damlengine/TodoWeblogSelectionElement.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/org/madore/damlengine/TodoWeblogSelectionElement.java b/org/madore/damlengine/TodoWeblogSelectionElement.java index c9088eb..637bc85 100644 --- a/org/madore/damlengine/TodoWeblogSelectionElement.java +++ b/org/madore/damlengine/TodoWeblogSelectionElement.java @@ -12,8 +12,8 @@ public final class TodoWeblogSelectionElement extends TodoDefaultElement { public enum Type { RECENT_COUNT, - MONTH_YEAR, - MONTH_MONTH, + MONTH_NUMERIC, + MONTH_LITERAL, CATEGORY_NAME, CATEGORY_CODE, SINGLE_NUMBER, @@ -114,19 +114,26 @@ public final class TodoWeblogSelectionElement extends TodoDefaultElement { newNode = ctx.doc.createTextNode(str); node.getParentNode().replaceChild(newNode, node); break; - case MONTH_YEAR: + case MONTH_NUMERIC: if ( ! ( ctx.wsc instanceof Context.WeblogMonthSelectionContext ) ) - throw new IllegalStateException("weblog-selection-month-year element encountered while not in weblog month selection state"); - str = ((Context.WeblogMonthSelectionContext)(ctx.wsc)).year; + throw new IllegalStateException("weblog-selection-month-numeric element encountered while not in weblog month selection state"); + str = ((Context.WeblogMonthSelectionContext)(ctx.wsc)).year + "-" + + ((Context.WeblogMonthSelectionContext)(ctx.wsc)).month; newNode = ctx.doc.createTextNode(str); node.getParentNode().replaceChild(newNode, node); break; - case MONTH_MONTH: + case MONTH_LITERAL: if ( ! ( ctx.wsc instanceof Context.WeblogMonthSelectionContext ) ) - throw new IllegalStateException("weblog-selection-month-month element encountered while not in weblog month selection state"); - str = ((Context.WeblogMonthSelectionContext)(ctx.wsc)).month; + throw new IllegalStateException("weblog-selection-month-literal element encountered while not in weblog month selection state"); + int mnum = Integer.parseInt(((Context.WeblogMonthSelectionContext)(ctx.wsc)).month); + String lang = LangHelper.getLangRec(node); + String[] mnames = TodoWeblogMonthsCalendar.monthNames.get(lang); + if ( mnames == null ) + mnames = TodoWeblogMonthsCalendar.monthNamesEn; + str = mnames[mnum] + " " + ((Context.WeblogMonthSelectionContext)(ctx.wsc)).year; newNode = ctx.doc.createTextNode(str); node.getParentNode().replaceChild(newNode, node); + LangHelper.setLangRec(node, lang); break; case CATEGORY_CODE: if ( ! ( ctx.wsc instanceof Context.WeblogCategorySelectionContext ) ) |