X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Date pikcer with arrows for previous/next year (https://forum.x-cart.com/showthread.php?t=77471)

Ed B. 01-04-2020 10:43 AM

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...

Ed B. 12-25-2020 02:15 AM

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

Ed B. 04-24-2021 06:41 AM

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...

Ed B. 04-25-2021 10:24 PM

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:oops:


And just in case this could be useful anyone, the view class for datepicker.js was \XLite\View\FormModel\Type\DatepickerType.php


All times are GMT -8. The time now is 07:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.