This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# Django Dana Time

Short, readable datetime filters.

### Install

### Usage

```python
{% load danatime %}

{{ datetime_instance|danatime:"previous year format" }}
```


### Formatting

Examples are shown with `en` translation/formatting and no arguments to the
template tag.

| timedelta | danatime |
|-------------------------|------------------------------|
| 0 seconds | now |
| 1 second | a second ago |
| 2 - 60 seconds | 2 - 60 seconds ago |
| 1 minute | a minute ago |
| 2 - 60 minutes | 2 - 60 minutes ago |
| 1 hour | an hour ago |
| 2 - 6 hours | 2 - 6 hours ago |
| 6 - 24 hours, same day | 4:26 p.m. |
| 6 - 24 hours, yesterday | 4:26 p.m. yesterday |
| \> 24 hours, same year | Aug 10 |
| previous year | 8/10/2012 |


### Internationalization Notes

All values are internationalized and localized by default using
[Django's internationalization and localization support](https://docs.djangoproject.com/en/1.9/topics/i18n/)

#### 6 - 24 hours (same day/yesterday)

Uses `defaultfilters.time`, which defaults to the localized
`settings.TIME_FORMAT`.

Example: In [en](https://github.com/django/django/blob/master/django/conf/locale/en/formats.py)
`TIME_FORMAT = 'P'`.

#### \> 24 hours, same year

Uses `defaultfilters.date` with an argument of `'MONTH_DAY_FORMAT'`, the
localized `settings.MONTH_DAY_FORMAT`.

Example: In [en](https://github.com/django/django/blob/master/django/conf/locale/en/formats.py)
`MONTH_DAY_FORMAT = 'F j'`.

#### previous year

Uses `defaultfilters.date` with an argument of `'n/j/Y'`.

Example: 10 August 2012 is formatted as `8/10/2012`.

Override this by passing an optional argument with a format to the filter tag.

#### previous year format examples:

Pass `None` to use the default, localized `settings.DATE_FORMAT`:

```
{{ mytime|danatime:None }}
```

Pass `SHORT_DATE_FORMAT` to use the localized `settings.SHORT_DATE_FORMAT`:

```
{{ mytime|danatime:"SHORT_DATE_FORMAT" }}
```

Pass a format string like `"F j, Y"` to use a custom format:

```
{{ mytime|danatime:"F j, Y" }}
```

This particular format yields `August 8, 2012`.

See Django's [available format strings](https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#date)
for help.
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-dana-time-0.1.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Jan 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting