Hello!
I'd like to have some sort of expression that looks something like <mvt:if expr="{product_custom_field_date} GT {todays_date}"> .... </mvt:if> but I'm not sure how best to compare dates in miva. First of all, how do you get today's date in mivascript? And then, is there a way to compare dates as a whole? According to http://www.mivascript.com/topic/time.html you can break out created_date time stamps into a readable format, or grab just the day, month, or year. But I already have the product custom field in a mm/dd/yyyy format so I don't know if those functions would even work with it?
This would be easy in JS, but I don't think you can read/write to miva global/local variables quite so easily in JS (although correct me if I'm wrong).
Thanks!
I'd like to have some sort of expression that looks something like <mvt:if expr="{product_custom_field_date} GT {todays_date}"> .... </mvt:if> but I'm not sure how best to compare dates in miva. First of all, how do you get today's date in mivascript? And then, is there a way to compare dates as a whole? According to http://www.mivascript.com/topic/time.html you can break out created_date time stamps into a readable format, or grab just the day, month, or year. But I already have the product custom field in a mm/dd/yyyy format so I don't know if those functions would even work with it?
This would be easy in JS, but I don't think you can read/write to miva global/local variables quite so easily in JS (although correct me if I'm wrong).
Thanks!
Comment