2 // ============================================================
5 // return a formated string for date
6 // @args: string (date string), boolean (include day of week)
7 // (it uses $_SESSION['language_choice'] )
8 // @return: $date_string (string) - formated string
9 // Cristian Navalici lemonsoftware at gmail dot com
11 // For Hebrew must be implemented a special calendar functions
13 // 10.07.2007 - dateformat accepts now an argument
14 // ============================================================
16 function dateformat($strtime = '', $with_dow = false)
19 // without an argument, display current date
21 $strtime = strtotime('now');
24 // string date is formed by
25 // $dow + date(day) + $nom + date(year) or similar
27 // name the day of the week for different languages
28 $day = date("w", $strtime); // 0 sunday -> 6 saturday
41 $dow = xl('Wednesday');
44 $dow = xl('Thursday');
50 $dow = xl('Saturday');
54 // name of the month in different languages
55 $month = (int) date('m', $strtime);
62 $nom = xl('February');
83 $nom = xl('September');
89 $nom = xl('November');
92 $nom = xl('December');
97 // First, get current language title
98 $languageTitle = getLanguageTitle($_SESSION['language_choice']);
99 switch ($languageTitle) {
100 // standard english first
101 case getLanguageTitle(1):
102 $dt = date("F j, Y", $strtime);
108 $dt = date("Y", $strtime) . " $nom " . date("d", $strtime);
114 case "Spanish (Spain)":
115 case "Spanish (Latin American)":
116 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
122 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
128 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
133 // hebrew (israel) , display english NOT jewish calendar
135 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
142 $dt = "$nom " . date("d", $strtime) . ", " . date("Y", $strtime);