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 Nunjucks filters for formatting dates #707

Closed
wants to merge 2 commits into from

Conversation

gonogo
Copy link

@gonogo gonogo commented Mar 7, 2019

This Nunjucks filter implementing moment.js to allow formatting of dates

eg. {{ tx.lastUpdated | date("DD-MMM-YY") }}

results in:

13-JUN-19

@NickColley
Copy link
Contributor

Hey @gonogo,

These look great!

Would you be willing to reduce the scope of your pull request to include only the date filter which has been requested a few times in the past: #170

If we get more evidence that a lot of people need the other filters we can consider them separately.

If you're OK with this then we'll also need tests and documentation to explain this functionality.

Let me know if you need any help with any of this, thanks again.

Nick

…delines, inserting commas every third digit

eg. 1000000 becomes 1,000,000
@gonogo
Copy link
Author

gonogo commented Mar 20, 2019

@NickColley I've now removed the other two filters - will submit as separate pull requests.

@gonogo gonogo changed the title Add new Nunjucks filters for formatting dates and numbers, and filtering on session data attributes Add new Nunjucks filters for formatting dates Mar 20, 2019
@gonogo
Copy link
Author

gonogo commented Mar 20, 2019

This should be complete now, pending CI checks.

@NickColley
Copy link
Contributor

Thanks a lot!

Would you be willing to write some tests and documentation for this feature?

@gonogo gonogo changed the title Add new Nunjucks filters for formatting dates Add Nunjucks filters for formatting dates Mar 20, 2019
@gonogo gonogo closed this Mar 29, 2019
@gonogo
Copy link
Author

gonogo commented Mar 29, 2019

Closing this, realistically there's no time left for me to do any more work on this as my contract finishes today. Might reopen this and get some work done on this next time I do some work on a GOV.UK project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants