[TYPO3-dev] Re: DatePicker in Backend Module

Sven Burkert bedienung at sbtheke.de
Thu Feb 13 09:02:53 CET 2014


The link is not valid any more, this is how you do it (in extbase environment):

		$doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
		$pageRenderer = $doc->getPageRenderer();
		// Load ExtJS
		$pageRenderer->loadExtJS();
		$pageRenderer->addJsFile('../t3lib/js/extjs/tceforms.js');
		$pageRenderer->addJsFile('../t3lib/js/extjs/ux/Ext.ux.DateTimePicker.js');
		// Define settings for Date Picker
		$typo3Settings = array(
			'datePickerUSmode' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? 1 : 0,
			'dateFormat' => array('j-n-Y', 'G:i j-n-Y'),
			'dateFormatUS' => array('n-j-Y', 'G:i n-j-Y')
		);
		$pageRenderer->addInlineSettingArray('', $typo3Settings);

		$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-pick-date', array(
			'style' => 'cursor:pointer;',
			'id' => 'picker-tceforms-datetimefield-start'
		));
		$this->view->assign('icon', $icon);


And in Fluid:
		<input name="tx_scheduler[start]" type="text" id="tceforms-datetimefield-start" value="" /><f:format.raw>{icon}</f:format.raw>



More information about the TYPO3-dev mailing list