News:

Support the VirtueMart project and become a member

Main Menu

Date field not working for shopper field

Started by palandre, March 25, 2018, 13:12:02 PM

Previous topic - Next topic

palandre

Hi mates,

I've added a new field "Data di nascita" for shoppers, with type "date". It appears when the user wants to register, but not with date picker, but with a simple text-area, even if in the firebug I can see the class datepicker.

The link is here:
http://shop.gallerialamongolfiera.it/shop/user/editaddresscartBT

Do you have any idea for this?

I use Joomla 3.8.6 and VM 3.2.13

Thanks a lot in advance,
Andrea

Studio 42

You have perhaps disabled datepicker file loading, because all code is here but datepicker or jquery.ui  is missing

palandre

Hi Studio 42,
Thanks for your feedback!

I was actually able to show the datepicker by checking "Use Virtuemart jQuery libraries". But I can see only future dates.

Can you suggest me where to setup datepicker inside Virtuemart jQuery?

Thanks again and regards,
Andrea

palandre

Found:

administrator/components/com_virtuemart/helpers/vmjsapi.php

Before:
self::addJScript('datepicker','
      jQuery(document).ready( function($) {
         $(document).on( "focus",".datepicker", function() {
            $( this ).datepicker({
               changeMonth: true,
               changeYear: true,
               '.$yearRange.'
               '.$minMax.'
               dateFormat:"'.$jsDateFormat.'",
               altField: $(this).prev(),
               altFormat: "yy-mm-dd"
            });


add:
$yearRange = 'yearRange: "1918:2018",';
$minMax = 'minDate: "-100Y", maxDate: "+1Y",';

Milbo

Please check the new version, I did changes there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/