The CreatorCon Call for Content is officially open! Get started here.

Adding days to a date in a client script

rdingus
Kilo Contributor

I have 2 date fields on a catalog item. In one date field, the user can enter or select a date. The other date field I am trying to populate by adding 30 days to the first date field using an onchange catalog client script. So to be clear, if date 1 is 2011-01-01, the onchange clent script for date 1 should populate date 2 by adding 30 days to date 1. In this example then date 2 would be 2011-01-31.

Can someone please instruct me on how to do this. It doesn't seem like it should be that difficult, but I can't figure it out, nor can I find any examples on how to do this.

Any help would be greatly appreciated.

Thank you.

Roger

1 REPLY 1

Mark Stanger
Giga Sage

Looks like somebody just came up with a solution for some of the common client-side date problems. You might try this post.

Client Script Date/Time Functions