PHP code example of heimrichhannot / contao-flatpickr-bundle
1. Go to this page and download the library: Download heimrichhannot/contao-flatpickr-bundle 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/ */
heimrichhannot / contao-flatpickr-bundle example snippets
$GLOBALS['TL_DCA']['tl_content']['fields']['date']['eval']['flatpickr']['active'] = true;
$GLOBALS['TL_DCA']['tl_content']['fields']['date'] = [
'eval' => [
'rgxp' => 'datim' # one of 'date', 'time' or 'datim'
'flatpickr' => [
'active' => true,
'options' => [], // Pass addtional flatpickr option, see configuration chapter
'plugins' => [], // Use and configure flatpickr plugins, see configuration chapter
],
]
];
$field['eval']['rgxp'] = 'time'
$GLOBALS['TL_DCA']['tl_content']['fields']['date']['eval']['flatpickr']['plugins']['monthSelectPlugin'] = [
'shorthand' => true,
'dateFormat' => "M Y",
'disabledMonths' => [2021 => [0,3,6]]
];
$GLOBALS['TL_DCA']['tl_content']['fields']['startDate']['eval']['flatpickr']['plugins']['rangePlugin'] = [
'input' => '#stopDate',
];