[SOLVED] sc_date macro error

Please look at the picture properly!

Then intention is to get the field dateOfCollection, add a number of days to it and put the result in the expiryDate.
The results are weird. I think this is a bug.

Let me know how to solve this!
Pleas not that the javascript message alert displays the alert date (expiry date properly) !!
So it seems to a problem in formatting…

date validation error.png

Try to get that code in the onchange event instead of the onclick.

Regards

Solved:
by formating the $expiryDate like this:

//Initializing the parameters to be add
$add_days = 1; //adding 30 days
$add_months = 0; //adding nothing to months
$add_years = 0; //adding nothing to years

$ExpiryDate = sc_date({DateOfCollection}, ‘yyyy/mm/dd’, ‘+’, $add_days, $add_months, $add_years);

{ExpiryDate} = sc_date_conv($ExpiryDate, “yyyy/mm/dd”, “aaaammdd”);


interestingly, the expiryDate format is dd/mm/yyyy!

this is definitely a bug

Bro,

Can you send me a screenshot of your solved issue please?

This sc_date macro is a little bit tricky!

[QUOTE=carlos;35477]Bro,

Can you send me a screenshot of your solved issue please?

This sc_date macro is a little bit tricky![/QUOTE]

ohh…guess i haven’t been here in a while…am going to send it later. ill try & replicate it later…its been a while.

Hello,

I’ll put this thread as solved, but you can post the solution later on.