Tribe__Date_Utils::datepicker_formats( int $translate = null )

Get the datepicker format, that is used to translate the option from the DB to a string


Parameters

$translate

(int) (Optional) The db Option from datepickerFormat

Default value: null


Top ↑

Return

(string|array) If $translate is not set returns the full array, if not returns the Y-m-d


Top ↑

Source

File: src/Tribe/Date_Utils.php

		public static function datepicker_formats( $translate = null ) {

			// The datepicker has issues when a period separator and no leading zero is used. Those formats are purposefully omitted.
			$formats = array(
				'Y-m-d',
				'n/j/Y',
				'm/d/Y',
				'j/n/Y',
				'd/m/Y',
				'n-j-Y',
				'm-d-Y',
				'j-n-Y',
				'd-m-Y',
				'Y.m.d',
				'm.d.Y',
				'd.m.Y',
			);

			if ( is_null( $translate ) ) {
				return $formats;
			}

			return isset( $formats[ $translate ] ) ? $formats[ $translate ] : $formats[0];
		}