Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Commit

Permalink
i think i got it
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethreitz committed Feb 17, 2016
1 parent 4ef88ed commit 8811357
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion requirements-to-freeze.txt
Expand Up @@ -7,7 +7,7 @@ html2text
mistune
psycopg2
pyquery
python-dateutil==1.5
dateparser
raven
requests
pytz
7 changes: 6 additions & 1 deletion requirements.txt
Expand Up @@ -2,23 +2,28 @@ BeautifulSoup==3.2.1
blinker==1.4
contextlib2==0.5.1
cssselect==0.9.1
dateparser==0.3.2
Flask==0.10.1
Flask-Script==2.0.5
Flask-SQLAlchemy==2.1
gunicorn==19.4.5
html2text==2016.1.8
itsdangerous==0.24
jdatetime==1.7.2
Jinja2==2.8
lxml==3.5.0
MarkupSafe==0.23
mistune==0.7.1
psycopg2==2.6.1
pyquery==1.2.11
python-dateutil==1.5
python-dateutil==2.4.2
pytz==2015.7
PyYAML==3.11
raven==5.10.2
requests==2.9.1
rfc3339==5
six==1.10.0
SQLAlchemy==1.0.12
umalqurra==0.2
Werkzeug==0.11.4
wheel==0.24.0
15 changes: 3 additions & 12 deletions star/utils.py
Expand Up @@ -8,22 +8,13 @@
"""

import datetime
import dateutil.parser
import pytz

import dateparser


def date(date):
"""Convert string dates (for the lazy)."""
if isinstance(date, basestring):
date = dateutil.parser.parse(unicode(date))

# Provided dates are in EST.
date = pytz.est.localize(date)

# Dates only, please.
assert isinstance(date, datetime.datetime)

return date
return datetparser.parse(date, settings={'TIMEZONE': 'US/Eastern'})


def date_range(start, end):
Expand Down

0 comments on commit 8811357

Please sign in to comment.