mdehoog / Semantic-UI-Calendar

Calendar module for Semantic UI
MIT License
804 stars 126 forks source link

Using in Symfony 3? #111

Closed TELLO0815 closed 6 years ago

TELLO0815 commented 6 years ago

Its not working in Symfony 3 for me. Is there any example or setting information for the form builder?

`$builder->add('galley', DateType::class, array(
                'label' => 'form.date',
                'widget' => 'single_text',
                'required' => true,
                'placeholder' => 'form.date',
                'attr' => array(
                    'class' => 'my class to get it via js',
                    'data-provide' => 'calendar',
                    'data-date-format' => 'yyyy-mm-dd' 
                )
            )
        );`

THX Mike

TELLO0815 commented 6 years ago
`monthFirst: false,
        formatter: {
            date: function (date, settings) {
                if (!date) return '';
                var day = date.getDate();
                var month = date.getMonth() + 1;
                var year = date.getFullYear();
                return year + '-' + month + '-' + day;
            }`

Was the key.