New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datetime type #95

Merged
merged 2 commits into from Jan 24, 2016

Conversation

Projects
None yet
4 participants
@item4
Contributor

item4 commented Jan 12, 2016

This PR implemented datetime type with timezone.

Usage

settings

[fields.pub_date]
label = Publication date
type = datetime

printing

{{ this.pub_date | datetimeformat('YYYY-MM-dd HH:mm:ss') }}

Python default

pub_date: 2016-01-13 01:02:03

With timezone abbreviations

pub_date: 2016-01-13 01:02:03 EST

With timezone name

pub_date: 2016-01-13 01:02:03 America/Dominica

With timedelta

pub_date: 2016-01-13 01:02:03 +0900
@mitsuhiko

This comment has been minimized.

Member

mitsuhiko commented Jan 12, 2016

Instead of importing pytz it would be cool if this would use the pytz indirection from babel.

@mitsuhiko

This comment has been minimized.

Member

mitsuhiko commented Jan 12, 2016

@item4

This comment has been minimized.

Contributor

item4 commented Jan 12, 2016

Yes, I'll change it

@item4

This comment has been minimized.

Contributor

item4 commented Jan 12, 2016

I remained pytz.FixedOffset for this case. (not timezone name, given timedelta)

pub_date: 2016-01-13 01:02:03 +0900
@item4

This comment has been minimized.

Contributor

item4 commented Jan 12, 2016

I didn't add new filter for datetime. Aleady you added it as datetimeformat

@mitsuhiko

This comment has been minimized.

Member

mitsuhiko commented Jan 12, 2016

That looks good! I will try to merge this on the weekend. Can you also send a pull request for docs against the website repo?

@item4

This comment has been minimized.

Contributor

item4 commented Jan 12, 2016

I'll try it.

mitsuhiko added a commit that referenced this pull request Jan 24, 2016

@mitsuhiko mitsuhiko merged commit ca42e93 into lektor:master Jan 24, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ajdavis

This comment has been minimized.

Contributor

ajdavis commented Jan 24, 2016

Ooh, I'm excited about this one!

@niijv

This comment has been minimized.

Contributor

niijv commented Jan 24, 2016

DateTime Picker is in the works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment