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 date_in_tz
filter.
#73
Conversation
@johannhof: I've just finished (I think) the |
Oh actually reading the other PR it's probably better to review this one first. Apologies! |
Ok this looks great, thanks. (I love how Rust + Clippy + rustfmt make reviewing so easy) One thing I'm a bit worried about would be adding too many (undocumented) filters to this. It's obviously great that people are contributing the filters they need but maybe we should hide all non-standard features behind a compiler flag. That could even be enabled by default but if someone really only wants the pure liquid experience they could disable the "extra-filters" feature. Can you please hide this behind a feature flag and put that feature in the defaults? You can find examples how to do that here: https://doc.rust-lang.org/book/conditional-compilation.html Thanks! |
Oh and thanks for adding so many tests to it! |
- Split tests out into separate functions following the most common pattern present in the existing tests. - Cause incorrect type for second argument to return InvalidArgument, not InvalidType. - Add test for incorrect type of timezone offset.
I added an "extra-filters" feature and set things up so that |
@johannhof I looked through the failed builds, but I'm not sure what to do to fix them. Let me know if it's something I did. |
Uh, good question. I retriggered it. :) |
Thanks! However, it looks like something is broken in the appveyor builds, because now it can't even find curl. |
@johannhof Any idea what might be causing the fail? I don't think the code is bad... |
I patched AppVeyor for cobalt.rs, I guess this needs the patch as well. I hope later today I can fix that |
Sorry for the delay, got my patch in. Travis will fail though on nightly because of clippy being broken again. |
@epage thank you! @johannhof could you kick off another test and/or merge this? I'd like to work on some other stuff but don't want to lose track of this. |
@johannhof can we get your recommendation on this documented in CONTRIBUTING so we set expectations (and remember them) when other people contribute features? |
Good idea! We should also document this flag in the README
I added you to the org, you should have kick-off-build rights on AppVeyor now (I also triggered a build though). |
Errors because of a caching problem. Should be good to go. |
Thanks! I'm traveling now, but will start the next project from the needs-help section this week. |
I wanted to add a date filter that would allow setting the timezone, so I created this filter based on the date filter. There is a lot of duplication between this filter and the date filter, but I decided to keep things simple for now.
Example use is:
{{ "13 Jun 2016 12:00:00 +0000" | date_in_tz: "%Y-%m-%d",-13 }}
, which would result in2016-06-12
.