Jump to content

Return value if date equal or greater than


Recommended Posts

Posted

Good morning. I need to return one price value if a date is equal to or greater than 6/13/2017 and another value if it's less than that date. Any help would be greatly appreciated.

 

Thank you,

 

Mike

Posted
I’m trying to write a code for a fusionpro template where if a date field is 6/13/2017 or later it returns “$6.99” and if it’s less than it returns “$4.99”. Is there an easy way to do this?
Posted

You could try this:

var [date, cutOff] = [ Field("YOUR DATE FIELD HERE"), "6/13/2017" ].map(DateFromString);
return date < cutOff ? "before value" : "after value";

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...