Viewing 1 reply thread
  • Author
    Posts
    • #2227
      tuckerjoenz
      Member

      Hello all! I am wondering and looking for a way to have a date field with a start and end date. What is the best way to do this with piklist? Thanks!

    • #2232
      Marcus
      Member
      piklist('field' ,array(
      	'type' => 'group'
      	,'label' => 'Dates (From - To)'
      	,'fields' => array(
      		array(
      			'type' => 'datepicker'
      			,'field' => 'date_from'
      			,'label' => 'Date: (from)'
      			,'options' => array(
      				'dateFormat' => 'M d, yy'
      				,'changeYear' => true
      			)
      			,'attributes' => array(
      				'class' => array('date')
      				,'size' => 12
      			)
      			,'columns' => 6
      			,'value' => date('M d, Y')
      		)
      		,array(
      			'type' => 'datepicker'
      			,'field' => 'date_to'
      			,'label' => 'Date: (to)'
      			,'options' => array(
      				'dateFormat' => 'M d, yy'
      				,'changeYear' => true
      			)
      			,'attributes' => array(
      				'class' => array('date')
      				,'size' => 12
      			)
      			,'columns' => 6
      			,'value' => date('M d, Y')
      		)
      	)
      ));
      

      Would be my best guess of how to do it quickly.

      Marcus

Viewing 1 reply thread
  • The topic ‘Datepicker with a date duration’ is closed to new replies.