Bootstrap datetime picker

Merge request reports

Loading
+3 −3
Changes for config/module.config.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace UnicaenApp;

use UnicaenApp\Service\Mailer\MailerService;
use UnicaenApp\Service\Mailer\MailerServiceFactory;
use UnicaenApp\View\Helper\QueryParamsHelperFactory;

return [
    /**
@@ -334,7 +333,8 @@ return [
            'userProfileSelect' => 'UnicaenAuth\View\Helper\UserProfileSelectFactory',
            'Message'           => 'UnicaenApp\Message\View\Helper\MessageHelperFactory',
            'messenger'         => 'UnicaenApp\View\Helper\MessengerFactory',
            'queryParams'       => QueryParamsHelperFactory::class,
            'queryParams'       => View\Helper\QueryParamsHelperFactory::class,
            'formControlGroup'  => Form\View\Helper\FormControlGroupFactory::class,
        ],
        'invokables'   => [
            'appConnection'             => 'UnicaenApp\View\Helper\AppConnection',
@@ -345,8 +345,8 @@ return [
            'multipageFormNav'          => 'UnicaenApp\Form\View\Helper\MultipageFormNav',
            'multipageFormRow'          => 'UnicaenApp\Form\View\Helper\MultipageFormRow',
            'multipageFormRecap'        => 'UnicaenApp\Form\View\Helper\MultipageFormRecap',
            'formControlGroup'          => 'UnicaenApp\Form\View\Helper\FormControlGroup',
            'formDate'                  => 'UnicaenApp\Form\View\Helper\FormDate',
            'formDateTime'              => Form\View\Helper\FormDateTime::class,
            'formDateInfSup'            => 'UnicaenApp\Form\View\Helper\FormDateInfSup',
            'formRowDateInfSup'         => 'UnicaenApp\Form\View\Helper\FormRowDateInfSup',
            'formSearchAndSelect'       => 'UnicaenApp\Form\View\Helper\FormSearchAndSelect',
+37
Changes for doc/widgets/bootstrap-datetimepicker.md: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Bootstrap DateTimePicker

Utilise le composant suivant : https://eonasdan.github.io/bootstrap-datetimepicker
pour dessiner des composants DateTime, Date ou Time.

## Installation

Attention : ce composant n'est pas activé par défaut. Il faut ajouter le code Javascript suivant
dans votre fichier `public/js/app.js` en adptant les URL débutant par `vendor/unicaen/app/` à votre contexte :

```javascript
/* DateTime Picker */
WidgetInitializer.add('bootstrap-datetimepicker', 'bootstrapDatetimepicker', function(){
    WidgetInitializer.includeJs(Url('vendor/unicaen/app/js/bootstrap-datetimepicker.min.js'));
    WidgetInitializer.includeCss(Url('vendor/unicaen/app/css/bootstrap-datetimepicker.min.css'));
});
```

## Usage

Voici un exemple de composant ajouté à un formulaire Zend :

```php
$this->add([
    'type'       => 'DateTime',
    'name'       => 'horaire-debut',
    'options'    => [
        'label'  => 'Horaire de début',
        'format' => \UnicaenApp\Util::DATETIME_FORMAT, /* Formats de DateTime au standard PHP. La conversion en format MomentJS est automatique */
        /* Placez ici d'autres options que vous souhaiteriez transmettre au widget */
    ],
]);
```

Ce code fait appel au composant standard `DateTime` du Zend Framework.
Il n'y a rien de spécifique à faire dans la vue, à part utiliser l'aide de vue `FormControlGroup` 
pour afficher le composant.
+3
Changes for doc/widgets.md: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Widgets Javascript

[Bootstrap DatetimePicker](./widgets/bootstrap-datetimepicker.md)
 No newline at end of file
+5

File added.

Generated files are collapsed by default. To change this behavior, edit the .gitattributes file. Learn more.

+21

File added.

Generated files are collapsed by default. To change this behavior, edit the .gitattributes file. Learn more.

Loading
Loading