Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthewpattell/yii2-working-date-time-widget
Working day and time input widget for yii2.
https://github.com/matthewpattell/yii2-working-date-time-widget
Last synced: about 1 month ago
JSON representation
Working day and time input widget for yii2.
- Host: GitHub
- URL: https://github.com/matthewpattell/yii2-working-date-time-widget
- Owner: MatthewPattell
- Created: 2017-10-20T14:09:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T21:56:25.000Z (almost 7 years ago)
- Last Synced: 2024-04-20T05:20:22.321Z (9 months ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
DayDateTime Widget for Yii2
===========================
Input day/time/dinner widgetInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
![Sample](https://github.com/MatthewPattell/yii2-working-date-time-widget/blob/master/sample.png?raw=true "Example screenshot")
Either run
```
php composer.phar require --prefer-dist matthew-p/yii2-working-date-time-widget "*"
```or add
```
"matthew-p/yii2-working-date-time-widget": "*"
```to the require section of your `composer.json` file.
Usage
-----Once the extension is installed, simply use it in your code by:
```php
= \MP\WorkingDatetime\WorkingDays::widget(['name' => 'example']); ?>
```**Options:**
```php
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
])
```If you dynamic add widget to page, run (js):
```js
MPWorkingDays.reInit(); // Set default settings only for NEW widgets
```
or
```js
MPWorkingDays.reInit({newId: 'oldId'}); // Copy settings from previous widget
```
or
```js
MPWorkingDays.reInit({newId: {settings...}}); // Set new widget settings
```Set dynamicaly widget settings:
```js
MPWorkingDays.addInputSettings(widgetID, {settings...});
```**Yii2 Model Required Validator:**
```php
/**
* @inheritdoc
*/
public function rules()
{
return [
['workday', WorkingDaysRequiredValidator::class]
];
}
```