Main Menu
Contact
Popular Plugins
Sign In

The Date Time field type works out of the box without configuring. You may want to output something different in your view though, than a "timestamp" like "2018-12-25 00:00:00". So here's how you do it. In your config file in the "view" key, you can add a format, like so:

"view" => [
	"format" => "d F Y",
]

The characters that you can use can be viewed at the PHP date - Manual page. The format example above will output "25 December 2018" with the given timestamp above.

Aside from view settings, you can also have settings for your form. These go into the "config" key of the array. Below a full config example:

"config"     => [
	"pick_date"    => true,
	'pick_time'    => true,
	'use_minutes'  => true,
	'use_seconds'  => true,
	'use_current'  => true,
	'show_today'   => true,
	'use_strict'   => false,
	'side_by_side' => true,

	'minute_stepping' => 5,
	'min_date'        => '1/1/1970',
	'max_date'        => '1/1/2020',
	'default_date'    => '',

	'icon_time' => 'glyphicon glyphicon-time',
	'icon_date' => 'glyphicon glyphicon-calendar',
	'icon_up'   => 'glyphicon glyphicon-chevron-up',
	'icon_down' => 'glyphicon glyphicon-chevron-down',

	'language'                    => 'en',
	'disabled_dates'              => ["11/22/2013", "12/25/2017"],
	'enabled_dates'               => [],
    'days_of_week_disabled_dates' => [3, 4], // array of numbers from 0-6
]

The keys should pretty much explain what they mean and there are some values set to know what you'd need to enter. You can copy the full working example below into your config file and change it to however you'd like it to be.

"myBirthday"     => [
	"type"       => "DateTime",
	"label"      => t("My Birthday"),
	"required"   => true,
	"searchable" => true,
	"view"       => [
		"format" => "d F Y H:i:s",
	],
	"config"     => [
		"pick_date"    => true,
		'pick_time'    => true,
		'use_minutes'  => true,
		'use_seconds'  => true,
		'use_current'  => true,
		'show_today'   => true,
		'use_strict'   => false,
		'side_by_side' => true,

		'minute_stepping' => 5,
		'min_date'        => '1/1/1970',
		'max_date'        => '1/1/2020',
		'default_date'    => '',

		'icon_time' => 'glyphicon glyphicon-time',
		'icon_date' => 'glyphicon glyphicon-calendar',
		'icon_up'   => 'glyphicon glyphicon-chevron-up',
		'icon_down' => 'glyphicon glyphicon-chevron-down',

		'language'                    => 'en',
		'disabled_dates'              => ["11/22/2013", "12/25/2017"],
		'enabled_dates'               => [],
		'days_of_week_disabled_dates' => [3, 4], // array of numbers from 0-6
	]
],

Use, by you or one client, in a single end product. The total price includes the item price and a buyer fee.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Concrete5 buyer fee: $32.70
Add to Concrete5 Cart

Use, by you or a client, in 5 single end products. The total price includes the item price and a buyer fee.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Concrete5 buyer fee: $130.80
  • Save an extra: $109.00
Add to Concrete5 Cart

Use, by you or a client, in x/xx single end products.

Upon request, quote will be made and sent to you via email.

  • Quality checked by Concrete5
  • Future updates
  • 30 Day Support
  • Saves extra $$
Request Quote
Released 4 years ago
Updated 3 years ago
Requires concrete5 5.7.5.3
Current version 0.9.7
Skill level Bleeding Edge

Buyer Rating:

5 average based on 2 ratings More information

Got something to say? Need help?

View support forum