PHP code example of matthew-p / yii2-working-date-time-widget

1. Go to this page and download the library: Download matthew-p/yii2-working-date-time-widget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

matthew-p / yii2-working-date-time-widget example snippets


<?= \MP\WorkingDatetime\WorkingDays::widget(['name' => 'example']); 

WorkingDays::widget([
    'name' => 'example',
    
    'roundTheClock' => '00.00 - 00.00', // Default - 00.00 - 00.00. Round-The-Clock value
    'enableDinner' => true,             // Default - true. Enable/disable dinner input
    
    'autocompleteDays' => [],           // Default - []. Automatic filling of time for the specified days
                                        // Example: [1,2,5] or ['monday', 'friday']
                                        // Warning: FILLS TIME FROM THE FILLED DAY
])

/**
 * @inheritdoc
 */
public function rules()
{
    return [
        ['workday', WorkingDaysRequiredValidator::class]
    ];
}
js
MPWorkingDays.reInit(); // Set default settings only for NEW widgets