Skip to content
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
Merged

Add datetime type #95

merged 2 commits into from
Jan 24, 2016

Conversation

item4
Copy link
Contributor

@item4 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
Copy link
Member

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

@mitsuhiko
Copy link
Member

@item4
Copy link
Contributor Author

item4 commented Jan 12, 2016

Yes, I'll change it

@item4
Copy link
Contributor Author

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
Copy link
Contributor Author

item4 commented Jan 12, 2016

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

@mitsuhiko
Copy link
Member

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
Copy link
Contributor Author

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
@ajdavis
Copy link
Contributor

ajdavis commented Jan 24, 2016

Ooh, I'm excited about this one!

@niijv
Copy link

niijv commented Jan 24, 2016

DateTime Picker is in the works too.

xlotlu pushed a commit that referenced this pull request Jun 13, 2020
Add lektor-creative-commons plugin to plugin list
xlotlu pushed a commit that referenced this pull request Jun 14, 2020
Add lektor-creative-commons plugin to plugin list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants