cfpb / sheer

A tool for loading arbitrary content into Elasticsearch and serving that content on the web.
Creative Commons Zero v1.0 Universal
29 stars 23 forks source link

Add when function to the context #113

Closed kurtrwall closed 9 years ago

kurtrwall commented 9 years ago

This adds a new function to the context called when. It takes two parameters: starttime and endtime. It is meant to figure out if the time period (between starttime and endtime) is in the past, present, or future. Actually, those are the strings it returns: 'past'/'present'/'future'.

This requires the package pytz. You have to run pip install -r requirements.txt in order for this to work.

@dpford @rosskarchner

kurtrwall commented 9 years ago

Changes pushed up @jimmynotjim

jimmynotjim commented 9 years ago

Tested and working :+1:

dpford commented 9 years ago

Yep works