Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Dates

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 9th, 2017, 06:06 AM
mteed11 mteed11 is offline
Junior Community Member
 
Join Date: Sep 2015
Posts: 10
Default Return value if date equal or greater than

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
Reply With Quote
  #2  
Old June 9th, 2017, 09:54 AM
mteed11 mteed11 is offline
Junior Community Member
 
Join Date: Sep 2015
Posts: 10
Default Return value if date equal or greater than

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?
Reply With Quote
  #3  
Old June 9th, 2017, 09:57 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Return value if date equal or greater than

You could try this:
Code:
var [date, cutOff] = [ Field("YOUR DATE FIELD HERE"), "6/13/2017" ].map(DateFromString);
return date < cutOff ? "before value" : "after value";
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.