Date Format Change to "dd-mm-yyyy" for catalog item variable

Rajarshi1
Tera Expert

Hi,

I have a requirement to populate the value of one catalog variable in "DD-MM-YYYY" format. This will happen based on a change in another catalog variable which is in "YYYY-MM-DD" format. I have written a catalog client script and a script include but the date format is not changing. It will be of great help if you suggest something on this. Am I missing something?

Client Script

find_real_file.png

Script Include

find_real_file.png

 

Output

find_real_file.png

Thanks,

Rajarshi

1 ACCEPTED SOLUTION

Try this-

After line 9

var formatdate= day.getByFormat("dd-MM-yyyy");

return formatdate;

 

View solution in original post

14 REPLIES 14

Try this-

After line 9

var formatdate= day.getByFormat("dd-MM-yyyy");

return formatdate;

 

Now its coming in correct format. But the result is in today's date all the time 

find_real_file.png

 

What is your requirement now?

 

It got fixed now. Thanks for your help. Below is the code snippet

find_real_file.png

Could you mark my answer correct and helpful as I have invested my time and provided the solution to you.