예제 #1
0
파일: User.php 프로젝트: hunglmtb/eb
 public function getConfiguration()
 {
     // 		$formatSetting 		= 	$this->configuration();//session('configuration');
     $formatSetting = session('configuration');
     $formatSetting = $formatSetting ? $formatSetting : DateTimeFormat::$defaultFormat;
     $dateFormat = $formatSetting['DATE_FORMAT'] ? $formatSetting['DATE_FORMAT'] : DateTimeFormat::$defaultFormat['DATE_FORMAT'];
     $timeFormat = $formatSetting['TIME_FORMAT'] ? $formatSetting['TIME_FORMAT'] : DateTimeFormat::$defaultFormat['TIME_FORMAT'];
     $decimalMarkFormat = $formatSetting['DECIMAL_MARK'] ? $formatSetting['DECIMAL_MARK'] : DateTimeFormat::$defaultFormat['DECIMAL_MARK'];
     $lowerDateFormat = strtolower($dateFormat);
     $carbonFormat = \Helper::convertDate2CarbonFormat($dateFormat);
     $jqueryFormat = \Helper::convertDate2JqueryFormat($dateFormat);
     $pickerTimeFormat = \Helper::convertTime2PickerFormat($timeFormat);
     $timeFormatSet = ['DATE_FORMAT' => $dateFormat, 'TIME_FORMAT' => $timeFormat, 'DATETIME_FORMAT' => "{$dateFormat} {$timeFormat}", 'DATE_FORMAT_UTC' => 'YYYY-MM-DD', 'TIME_FORMAT_UTC' => 'hh:mm:ss', 'DATETIME_FORMAT_UTC' => 'YYYY-MM-DD HH:mm:ss', 'DATE_FORMAT_CARBON' => $carbonFormat];
     $picker = ['DATE_FORMAT' => $lowerDateFormat, 'TIME_FORMAT' => $pickerTimeFormat, 'DATETIME_FORMAT' => "{$lowerDateFormat} {$pickerTimeFormat}", 'DATE_FORMAT_UTC' => 'mm/dd/yyyy', 'TIME_FORMAT_UTC' => 'hh:ii:ss', 'DATETIME_FORMAT_UTC' => 'mm/dd/yyyy hh:ii', 'DATE_FORMAT_JQUERY' => $jqueryFormat];
     $sample = DateTimeFormat::getSample($formatSetting);
     $numberFormat = ['DECIMAL_MARK' => $decimalMarkFormat];
     return ['time' => $timeFormatSet, 'picker' => $picker, 'number' => $numberFormat, 'sample' => $sample];
 }