2017 © Pedro PelĂĄez
 

symfony-bundle scdatetimepicker-bundle

Symfony bundle for Bootstrap DateTime picker

image

mwsimple/scdatetimepicker-bundle

Symfony bundle for Bootstrap DateTime picker

  • Monday, December 18, 2017
  • by gonzakpo
  • Repository
  • 1 Watchers
  • 5 Stars
  • 4,088 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 2 Versions
  • 53 % Grown

The README.md

DatetimepickerBundle

This bundle implements the Bootstrap DateTime Picker in a Form Type for Symfony 3. The bundle structure is inspired by GenemuFormBundle., (*1)

Demo : http://www.malot.fr/bootstrap-datetimepicker/demo.php, (*2)

Please feel free to contribute, to fork, to send merge request and to create ticket., (*3)

Installation

Step 1: Install DatetimepickerBundle

php composer.phar require mwsimple/scdatetimepicker-bundle

Step 2: Enable the bundle

``` php <?php // app/AppKernel.php, (*4)

public function registerBundles() { $bundles = array( // ... new SC\DatetimepickerBundle\SCDatetimepickerBundle(), ); }, (*5)


``` yml # app/config/config.yml sc_datetimepicker: picker: ~

Step 3: Initialize assets

``` bash $ php app/console assets:install web/, (*6)


## Usages ``` php <?php // ... use SC\DatetimepickerBundle\Form\Type\DatetimeType; public function buildForm(FormBuilder $builder, array $options) { $builder // defaut options ->add('createdAt', DatetimeType::class) // full options ->add('updatedAt', DatetimeType::class, array( 'pickerOptions' => array('format' => 'mm/dd/yyyy', 'weekStart' => 0, 'startDate' => date('m/d/Y'), //example 'endDate' => '01/01/3000', //example 'daysOfWeekDisabled' => '0,6', //example 'autoclose' => false, 'startView' => 'month', 'minView' => 'hour', 'maxView' => 'decade', 'todayBtn' => false, 'todayHighlight' => false, 'keyboardNavigation' => true, 'language' => 'en', 'forceParse' => true, 'minuteStep' => 5, 'pickerReferer ' => 'default', //deprecated 'pickerPosition' => 'bottom-right', 'viewSelect' => 'hour', 'showMeridian' => false, 'initialDate' => date('m/d/Y', 1577836800), //example ))) ; }

Add form_javascript and form_stylesheet, (*7)

The principle is to separate the javascript, stylesheet and html. This allows better integration of web pages., (*8)

Example:

``` twig {% block stylesheets %} , (*9)

{{ form_stylesheet(form) }}

{% endblock %}, (*10)

{% block javascripts %} , (*11)

{{ form_javascript(form) }}

{% endblock %}, (*12)

{% block body %}, (*13)

{{ form_widget(form) }}

{% endblock %} ```, (*14)

Documentation

The documentation of the datetime picker is here : http://www.malot.fr/bootstrap-datetimepicker/#options, (*15)

Notes

The date format from php 'pickerOptions' => array('format'=>'dd MM yyyy - HH:ii p') is used to set automatically the date format of Symfony in order to make compatible Symfony and JavaScript output. But there are some problems for example with php MM which display "décembre" in PHP intl translation and "Decembre" in Bootstrap translation. That is why I edited js/locales/bootstrap-datetimepicker.fr.js, (*16)

The Versions

18/12 2017

dev-master

9999999-dev

Symfony bundle for Bootstrap DateTime picker

  Sources   Download

MIT

The Requires

 

by Stephane Collot

bootstrap bundle symfony datepicker timepicker picker

07/12 2017

v2.0.0

2.0.0.0

Symfony bundle for Bootstrap DateTime picker

  Sources   Download

MIT

The Requires

 

by Stephane Collot

bootstrap bundle symfony datepicker timepicker picker