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

Delta Between Two Patch Sets: filters/humanize_date.py

Issue 29334171: Issue 3410 - Added date sort / format for press releases (Closed)
Left Patch Set: Changed humanize_dates to format a single date and removed space before argument list Created Feb. 4, 2016, 10:03 a.m.
Right Patch Set: Fixed datetime call Created Feb. 9, 2016, 4 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « filters/datesort.py ('k') | filters/teamsort.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import datetime, copy 1 from datetime import datetime
Sebastian Noack 2016/02/04 11:05:06 The import for the "copy" module isn't necessary a
juliandoucette 2016/02/04 11:18:39 Done. Good catch.
2 2
3 def humanize_date(date): 3 def humanize_date(date):
4 return datetime.datetime.strftime( 4 return datetime.strptime(date, "%Y-%m-%d").strftime("%B %d, %Y")
Sebastian Noack 2016/02/04 11:05:06 Simply, call methods on the instance itself, not o
juliandoucette 2016/02/04 11:18:39 Done. I was copying the style of the previous date
5 datetime.datetime.strptime(date, "%Y-%m-%d"),
6 "%B %d, %Y")
LEFTRIGHT

Powered by Google App Engine
This is Rietveld