Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: filters/humanize_dates.py

Issue 29334171: Issue 3410 - Added date sort / format for press releases (Closed)
Patch Set: Changing sort filters and utf8 charaters in release hrefs Created Feb. 2, 2016, 4:44 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « filters/datesort.py ('k') | filters/teamsort.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filters/humanize_dates.py
diff --git a/filters/humanize_dates.py b/filters/humanize_dates.py
new file mode 100644
index 0000000000000000000000000000000000000000..a85cad30c5133391cbbf042cc0f64bf76bef5c9f
--- /dev/null
+++ b/filters/humanize_dates.py
@@ -0,0 +1,9 @@
+import datetime, copy
+
+def humanize_dates (unformatted_list):
Sebastian Noack 2016/02/02 16:50:21 Nit: No space before arguments list.
juliandoucette 2016/02/04 10:04:22 Done.
+ formatted_list = copy.deepcopy(unformatted_list);
+ for item in formatted_list:
Sebastian Noack 2016/02/02 16:50:21 While looking at the template, is there actually a
juliandoucette 2016/02/04 10:04:22 Done.
+ item[0] = datetime.datetime.strftime(
+ datetime.datetime.strptime(item[0], "%Y-%m-%d"),
+ "%B %d, %Y")
+ return formatted_list
« no previous file with comments | « filters/datesort.py ('k') | filters/teamsort.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld