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

Handlebars now-1 for yesterday #15145

Open
mikesealey opened this issue Dec 9, 2024 · 2 comments
Open

Handlebars now-1 for yesterday #15145

mikesealey opened this issue Dec 9, 2024 · 2 comments
Labels
date Relating to dates, e.g. Date Picker, formatting, etc enhancement New feature or request

Comments

@mikesealey
Copy link
Collaborator

Describe the feature request
Currently, the way to specify one day ago is to do the following in JS

var date = new Date();
return date.setDate(date.getDate()-1);

A customer has asked for a {{ now-1 }} binding to get yesterday's date.

@mikesealey mikesealey added the enhancement New feature or request label Dec 9, 2024
Copy link

linear bot commented Dec 9, 2024

@aptkingston
Copy link
Member

It wouldn't be possible to support the now - 1 syntax, but I think there's already a ticket somewhere to add bindings for some common time frames/ranges... For this particular case we could add {{ yesterday }} in the meantime. I'll see if I can find the other ticket that mentions the others.

@ConorWebb96 ConorWebb96 added the date Relating to dates, e.g. Date Picker, formatting, etc label Dec 10, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
date Relating to dates, e.g. Date Picker, formatting, etc enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants