VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: dirkb on April 22, 2016, 22:12:49 PM

Title: datepicker date format in email confirmation
Post by: dirkb on April 22, 2016, 22:12:49 PM
hmmm ... trying, but not getting it to work. how can I change the date format for the datepicker (hold it) in the email confirmations ?

Use the datepicker as a shopper field. I am able to change the format in vmjsapi.php directly (altFormat: "dd-mm-yy") but where can I format the date for the admin and user confirmation emails ?

Its showing me "2016-04-08" for example ... not what I want. Modifying "vmjsapi.php" is also useless, since an update will overwrite it ... and the general LC3, LC4 language overwrites do not work here.

Help ? J 3.5 VM 3.0.14
Title: Re: datepicker date format in email confirmation
Post by: dirkb on April 22, 2016, 22:23:10 PM
and the COM_VIRTUEMART_DATE_FORMAT_INPUT_J16="d.m.y" constant is obviously not doing anything here, getting "2016-04-08" ???
Title: Re: datepicker date format in email confirmation
Post by: GJC Web Design on April 22, 2016, 23:12:36 PM
I over ride the date format at the template with JS

something like below then the date is stored as i want it


jQuery(document).ready( function($) {
$(document).on( "focus",".datepicker", function() {
if(this.id == 'vm_deliver_date_field_text'){ //id of datepicker
$( this ).datepicker({
dateFormat:"dd-mm-yy"
}
}
});
});


code not checked
Title: Re: datepicker date format in email confirmation
Post by: dirkb on April 22, 2016, 23:50:03 PM
hmmm ... I will have to try that - if I read that right, add the function in the template/js/template.js - and replace the "vm_deliver_date_field_text" with the field name ... Hmmm, not tried it, but are you sure that this will allow me to format the datepicker date format up to the invoice.php and mail_html.php level ?
Title: Re: datepicker date format in email confirmation
Post by: GJC Web Design on April 22, 2016, 23:55:07 PM
It can go anywhere that is loaded in the user fields dialog

in my case lately I used it in templates\xxxxxx\html\com_virtuemart\cart\default_cartfields.php

re format.. this is the whole point.. it SAVES the string as dd-mm-yy or whatever in the orders_userinfos table so no conversion is needed anywhere .. it is done
Title: Re: datepicker date format in email confirmation
Post by: dirkb on April 22, 2016, 23:58:58 PM
perfect ... will try that tomorrow - Danke