News:

Support the VirtueMart project and become a member

Main Menu

Date picker not showing years (VM3)

Started by OriyanJ, December 28, 2015, 17:15:19 PM

Previous topic - Next topic

OriyanJ

Suddenly my drop down year picker isn't showing year no more, on any page. Any ideas what has happened?
VirtueMart 3.2.2

GJC Web Design

is set in the call (vm3.0.12)

vmjsapi.php

// Virtuemart Datepicker script
   static function jDate($date='',$name="date",$id=NULL,$resetBt = TRUE, $yearRange='') {

      if ($yearRange) {
         $yearRange = 'yearRange: "' . $yearRange . '",';
      }

where are you calling it?

the sublayouts/customfields.php doesn't seem to have a date range call.  :(

$customfield->display =  '<span class="product_custom_date">' . vmJsApi::jDate ($customfield->customfield_value,$customProductDataName) . '</span>';

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OriyanJ

I'm not quite sure I get your question, but I'm using VirtueMart 3.0.11.4. The script looks like (/components/com_virtuemart/helpers/vmjsapi.php) -

// Virtuemart Datepicker script
static function jDate($date='',$name="date",$id=NULL,$resetBt = TRUE, $yearRange='') {

if ($yearRange) {
$yearRange = 'yearRange: "' . $yearRange . '",';
}


The year picker wont work on front-end nor back-end.
VirtueMart 3.2.2

GJC Web Design

well .. that's what I told you.....

and I asked where you are calling it because in the custom field sublayouts there is no value for $yearRange that I can see

vmJsApi::jDate ($customfield->customfield_value,$customProductDataName)

try "2015:2019"

vmJsApi::jDate ($customfield->customfield_value,$customProductDataName,NULL,TRUE,"2015:2019")
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OriyanJ

Oh, I'm sorry. I call it with a shopper field (such as birth date).

I've tried using vmJsApi::jDate ($customfield->customfield_value,$customProductDataName,NULL,TRUE,"2015:2019") but that didn't work.
VirtueMart 3.2.2

OriyanJ

#5
SOLVED:

Changed administrator/components/com_virtuemart/helpers/vmjsapi.php
694 : $yearRange = 'yearRange: "1980:2030",';

Thanks for guiding me.
VirtueMart 3.2.2

GJC Web Design

I think there is a case for a fallback there

if ($yearRange) {
         $yearRange = 'yearRange: "' . $yearRange . '",';
      }else{

                      $yearRange = 'yearRange: "2015:2020",';
}

or what ever (use current date() etc)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OriyanJ

Yeah, that's a good idea, I think I'll just make it use date('Y')-80 and date('Y')+15 as range.
VirtueMart 3.2.2

GJC Web Design

a bit discriminatory against 90 year olds..  ;)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OriyanJ

VirtueMart 3.2.2