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

Trouble Adding Days to Date #16

Open
harnerdesigns opened this issue May 13, 2020 · 1 comment
Open

Trouble Adding Days to Date #16

harnerdesigns opened this issue May 13, 2020 · 1 comment

Comments

@harnerdesigns
Copy link

Given date = 2020-04-23T14:09:00.977 The below code both output the same result,

{{moment date format="MM/DD/YYYY"}}
{{moment date add="{day:20}" format="MM/DD/YYYY"}}

// 04/23/2020 
// 04/23/2020 

I'm essentially looking to see if a specific date was less than 20 days ago.

{{#if (moment "now" format="MM/DD/YYYY") ">=" (moment date add="{days:20}" format="MM/DD/YYYY") }}
// do something
{{/if}}

I know there's the from function: {{moment from=date}} but that returns a string "in 19 days" and not a number.

Maybe I'm just missing a function or something but I could really use some help here.

Thanks!

@anicache08
Copy link

Hi any news about this one? It seems that the "add" and "subtract" helper were not working. Thanks!

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

No branches or pull requests

2 participants