helpers/handlebars-helper-moment

Trouble Adding Days to Date

harnerdesigns opened this issue · 1 comments

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!

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