X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;fp=includes%2Fcurrent_user.inc;h=87f71b1e45ce2a6c9ee10357bb4f3cc1ae4ee3c1;hb=211598c5964fd138631395c7f329ec8b87c43c0b;hp=8c754aec8f11091f835806537a75651fd9058b2d;hpb=40c3b111b007ad16a2eedff175e1612150191d04;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 8c754aec..87f71b1e 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -486,9 +486,27 @@ function user_date_format() function user_date_display() { - global $SysPrefs; - - return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_display() : $SysPrefs->dflt_date_sep; + $fmt ='m/d/Y'; + if (isset($_SESSION["wa_current_user"])) { + $fmt = $_SESSION["wa_current_user"]->prefs->date_display(); + } else { + $sep = user_date_sep(); + $user_date_fmt = user_date_format(); + switch ($user_date_fmt) { + case 0: + $fmt = "m".$sep."d".$sep."Y"; break; + case 1: + $fmt = "d".$sep."m".$sep."Y"; break; + case 2: + $fmt = "Y".$sep."m".$sep."d"; break; + case 3: + $fmt = "M".$sep."j".$sep."Y"; break; + case 4: + $fmt = "j".$sep."M".$sep."Y"; break; + default: + $fmt = "Y".$sep."M".$sep."j"; + } + } } function user_date_sep()