Compare commits

...

7 Commits

Author SHA1 Message Date
Timo Furrer b016434b6f release: v0.6.0 2018-12-14 13:31:21 +01:00
Timo Furrer bdf2bb332b Merge pull request #166 from kennethreitz/feature/pendulum-2
Use pendulum >= 2.0.2
2018-12-14 13:30:22 +01:00
Timo Furrer 6522525d7c alpha release: 0.6.0a1 2018-12-02 13:37:48 +00:00
Timo Furrer 3a83f10988 Use pendulum >= 2.0.2. Closes #160 2018-12-02 13:31:22 +00:00
Timo Furrer 05eb0d0051 Merge pull request #164 from possnfiffer/patch-1
Update README.rst
2018-10-18 11:31:58 +02:00
__ROLLER__ 61eabc54e0 Update README.rst 2018-10-15 22:05:26 -06:00
kennethreitz 6bb380e7c5 Update README.rst 2018-09-17 08:12:21 -04:00
5 changed files with 14 additions and 6 deletions
+5
View File
@@ -1,3 +1,8 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
freezegun = "*"
pytest = "*"
+2 -1
View File
@@ -26,6 +26,7 @@ Art by `Sam Flores
<https://www.instagram.com/samagram12/>`_ (Photo by `Kenneth Reitz
<https://www.instagram.com/kennethreitz/>`_).
If you're interested in financially supporting Kenneth Reitz open source, consider `visiting this link <https://cash.me/$KennethReitz>`_. Your support helps tremendously with sustainability of motivation, as Open Source is no longer part of my day job.
☤ Basic Usage of Maya
---------------------
@@ -137,7 +138,7 @@ From here, there are a number of methods available to you, which you can use to
☤ What about Delorean, Arrow, & Pendulum?
-----------------------------------------
All these project complement each other, and are friends. Pendulum, for example, helps power Maya's parsing.
All these projects complement each other, and are friends. Pendulum, for example, helps power Maya's parsing.
Arrow, for example, is a fantastic library, but isn't what I wanted in a datetime library. In many ways, it's better than Maya for certain things. In some ways, in my opinion, it's not.
+1 -1
View File
@@ -1 +1 @@
__version__ = '0.5.0'
__version__ = '0.6.0'
+5 -3
View File
@@ -346,7 +346,6 @@ class MayaDT(object):
except KeyError:
pass
dt.set_formatter("alternative")
delta = humanize.time.abs_timedelta(
timedelta(seconds=(self.epoch - now().epoch)))
@@ -497,7 +496,7 @@ class MayaInterval(object):
try:
end = parse(end)
except pendulum.parsing.exceptions.ParserError as e:
except (pendulum.parsing.exceptions.ParserError, TypeError) as e:
end = cls.parse_iso8601_duration(end, start=start)
return cls(start=start, end=end)
@@ -740,7 +739,7 @@ def when(string, timezone='UTC', prefer_dates_from='current_period'):
return MayaDT.from_datetime(dt)
def parse(string, timezone='UTC', day_first=False, year_first=True):
def parse(string, timezone='UTC', day_first=False, year_first=True, strict=False):
""""Returns a MayaDT instance for the machine-produced moment specified.
Powered by pendulum.
@@ -755,11 +754,14 @@ def parse(string, timezone='UTC', day_first=False, year_first=True):
between YDM and YMD. (default: False)
year_first -- if true, the first value (e.g. 2016/05/01)
is parsed as year (default: True)
strict -- if False, allow pendulum to fall back on datetime parsing
if pendulum's own parsing fails
"""
options = {}
options['tz'] = timezone
options['day_first'] = day_first
options['year_first'] = year_first
options['strict'] = strict
dt = pendulum.parse(str(string), **options)
return MayaDT.from_datetime(dt)
+1 -1
View File
@@ -25,7 +25,7 @@ required = [
'pytz',
'dateparser>=0.7.0',
'tzlocal',
'pendulum>=1.0, <=1.5.1',
'pendulum>=2.0.2',
'snaptime'
]