Jump to content

Insert available date automatically


mikemiranda

Recommended Posts

Hello guys, sorry for my english i am using a module that allow the client to become a seller, i want to automatically set the available date to 7 days from current date and disable the field (easy part).

 

Can anybody know how to get the current date and add some days on the tpl file? or it needs another modification? Thanks in advance

post-756889-0-46264100-1394464927_thumb.png

Link to comment
Share on other sites

Hello,

 

If you find the template you can modify it like that :

 

 

{literal}
jQuery(function($){
    var d = new Date();
    d.setDate(d.getDate()+7);
 
    $('#id_of_input_available_date').value(d.toLocaleDateString());
});
{literal}

 

Of course you have to modify it to fit with id in your tpl and date format expected by the module.

 

This is a way to do it, modifying php in module could also,perhaps, do the job.

 

Regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...