Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Date pikcer with arrows for previous/next year

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-04-2020, 10:43 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Date pikcer with arrows for previous/next year

Would there be a way to put arrows to change years in datepicker widget
\XLite\View\FormField\Input\Text\Date ?



I went through lots and lots of files,
but I have been unable to figure out which one was responsible for outputting the actual datepicker. The best information I could get was the fact that the file
skins/admin/form_field/input/text/date.less contains lots of css rules on elements
in the css class .ui-datepicker-something, but there aren't even a css element like that on the page where the datepicker appears...
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #2  
Old 12-25-2020, 02:15 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Date pikcer with arrows for previous/next year

I have found a work-around, it "suffices" to add a line
Code:
changeYear: true,
after

Code:
$el.datepicker({
to skins/admin/form_model/type/datepicker_type.js (in the case of 5.4.1.x). Now, how can I achieve this "correctly", without creating a whole skin? I can't figure out which class is calling this file. \XLite\View\FormField\Input\Text\Date only says
Code:
public function getCommonFiles() { $list = parent::getCommonFiles(); $list[static::RESOURCE_JS][] = 'js/jquery-ui-i18n.min.js'; $list[static::RESOURCE_JS][] = 'form_field/js/date.js'; $list[static::RESOURCE_CSS][] = 'form_field/css/date.less'; return $list; }
no mention of datepicer_type.js
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #3  
Old 04-24-2021, 06:41 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Date pikcer with arrows for previous/next year

Quote:
Originally Posted by Ed B.
I have found a work-around, it "suffices" to add a line
Code:
changeYear: true,
after

Code:
$el.datepicker({
to skins/admin/form_model/type/datepicker_type.js (in the case of 5.4.1.x). Now, how can I achieve this "correctly", without creating a whole skin? I can't figure out which class is calling this file. \XLite\View\FormField\Input\Text\Date only says
Code:
public function getCommonFiles() { $list = parent::getCommonFiles(); $list[static::RESOURCE_JS][] = 'js/jquery-ui-i18n.min.js'; $list[static::RESOURCE_JS][] = 'form_field/js/date.js'; $list[static::RESOURCE_CSS][] = 'form_field/css/date.less'; return $list; }
no mention of datepicer_type.js


In the current version, it is skins/common/form_field/js/date.js that I have to change...
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #4  
Old 04-25-2021, 10:24 PM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Date pikcer with arrows for previous/next year

Quote:
Originally Posted by Ed B.
In the current version, it is skins/common/form_field/js/date.js that I have to change...




Of course, it suffices to override \XLite\View\FormField\Input\Text\Date how stupid of me


And just in case this could be useful anyone, the view class for datepicker.js was \XLite\View\FormModel\Type\DatepickerType.php
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote

The following user thanks Ed B. for this useful post:
memoto (04-26-2021)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:07 PM.

   

 
X-Cart forums © 2001-2020