Skip to content

Instantly share code, notes, and snippets.

@henryme27
Created December 21, 2016 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryme27/17020933087f432205391eb9d3cd287e to your computer and use it in GitHub Desktop.
Save henryme27/17020933087f432205391eb9d3cd287e to your computer and use it in GitHub Desktop.
How to fix can not select date in Datetimepicker with Plugin Noo Timetable
<?php
/**
* How to fix can not select date in Datetimepicker with Plugin Noo Timetable.
*
* Place to fix: plugins/noo-timetable/inc/functions/template-func.php
*
* @see https://cloudup.com/cNEfTzkMUlq
* @author Henry Me
*/
if( !function_exists('noo_timetable_getJqueryUII18nLocale') ) {
function noo_timetable_getJqueryUII18nLocale() {
$locale = str_replace( '_', '-', get_locale() );
$locale = substr($locale, 0, strpos($locale, '-'));
$allLoc = array(
'ar',
'id',
'bg',
'fa',
'ru',
'uk',
'en',
'el',
'de',
'nl',
'lt',
'tr',
'fr',
'es',
'th',
'pl',
'pt',
'ch',
'se',
'sv',
'kr',
'it',
'da',
'no',
'ja',
'vi',
'sl',
'cs',
'hu'
);
if ( ! in_array($locale, $allLoc) ) {
$locale = 'en';
}
$locale = apply_filters( 'noo_timetable_get_locale', $locale );
if ( $locale == '' ) {
$locale = 'en';
}
return $locale;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment