|
1 | 1 | Changelog |
2 | 2 | ========= |
3 | 3 |
|
| 4 | +1.1.0 (2021-04-26) |
| 5 | +------------------ |
| 6 | + |
| 7 | +- [NEW] Implemented the ``dehumanize`` method for ``Arrow`` objects. This takes human readable input and uses it to perform relative time shifts, for example: |
| 8 | + |
| 9 | +.. code-block:: python |
| 10 | +
|
| 11 | + >>> arw |
| 12 | + <Arrow [2021-04-26T21:06:14.256803+00:00]> |
| 13 | + >>> arw.dehumanize("8 hours ago") |
| 14 | + <Arrow [2021-04-26T13:06:14.256803+00:00]> |
| 15 | + >>> arw.dehumanize("in 4 days") |
| 16 | + <Arrow [2021-04-30T21:06:14.256803+00:00]> |
| 17 | + >>> arw.dehumanize("in an hour 34 minutes 10 seconds") |
| 18 | + <Arrow [2021-04-26T22:40:24.256803+00:00]> |
| 19 | + >>> arw.dehumanize("hace 2 años", locale="es") |
| 20 | + <Arrow [2019-04-26T21:06:14.256803+00:00]> |
| 21 | +
|
| 22 | +- [NEW] Made the start of the week adjustable when using ``span("week")``, for example: |
| 23 | + |
| 24 | +.. code-block:: python |
| 25 | +
|
| 26 | + >>> arw |
| 27 | + <Arrow [2021-04-26T21:06:14.256803+00:00]> |
| 28 | + >>> arw.isoweekday() |
| 29 | + 1 # Monday |
| 30 | + >>> arw.span("week") |
| 31 | + (<Arrow [2021-04-26T00:00:00+00:00]>, <Arrow [2021-05-02T23:59:59.999999+00:00]>) |
| 32 | + >>> arw.span("week", week_start=4) |
| 33 | + (<Arrow [2021-04-22T00:00:00+00:00]>, <Arrow [2021-04-28T23:59:59.999999+00:00]>) |
| 34 | +
|
| 35 | +- [NEW] Added Croatian, Latin, Latvian, Lithuanian and Malay locales. |
| 36 | +- [FIX] Internally standardize locales and improve locale validation. Locales should now use the ISO notation of a dash (``"en-gb"``) rather than an underscore (``"en_gb"``) however this change is backward compatible. |
| 37 | +- [FIX] Correct type checking for internal locale mapping by using ``_init_subclass``. This now allows subclassing of locales, for example: |
| 38 | + |
| 39 | +.. code-block:: python |
| 40 | +
|
| 41 | + >>> from arrow.locales import EnglishLocale |
| 42 | + >>> class Klingon(EnglishLocale): |
| 43 | + ... names = ["tlh"] |
| 44 | + ... |
| 45 | + >>> from arrow import locales |
| 46 | + >>> locales.get_locale("tlh") |
| 47 | + <__main__.Klingon object at 0x7f7cd1effd30> |
| 48 | +
|
| 49 | +- [FIX] Correct type checking for ``arrow.get(2021, 3, 9)`` construction. |
| 50 | +- [FIX] Audited all docstrings for style, typos and outdated info. |
| 51 | + |
4 | 52 | 1.0.3 (2021-03-05) |
5 | 53 | ------------------ |
6 | 54 |
|
|
0 commit comments