1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
8 * decide what date format to use for calendar
10 * NOTE!!! nagstat::date_format has the same thing, with time
12 public static function get_calendar_format($get_php=false)
15 $nagios_config = System_Model
::parse_config_file('nagios.cfg');
16 $nagios_format_name = $nagios_config['date_format'];
17 switch (strtolower($nagios_format_name)) {
18 case 'us': # MM-DD-YYYY
19 $date_format = 'mm/dd/yyyy';
21 case 'euro': # DD-MM-YYYY
22 $date_format = 'dd/mm/yyyy';
24 case 'iso8601': # YYYY-MM-DD
25 $date_format = 'yyyy-mm-dd';
27 case 'strict-iso8601': # YYYY-MM-DD
28 $date_format = 'yyyy-mm-dd';
32 # convert to PHP equivalent
33 if ($get_php === true) {
34 $date_format = str_replace('yyyy', 'Y', $date_format);
35 $date_format = str_replace('mm', 'm', $date_format);
36 $date_format = str_replace('dd', 'd', $date_format);