updates and additions
[webos-internals:modifications.git] / top-bar / top-bar-date-and-am-pm-indicator.patch
1 diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2 index 0e239cc..ec6f404 100644
3 --- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4 +++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5 @@ -2988,7 +2988,17 @@ updateClockEveryMinute: function() {
6         else
7                 format = Mojo.Format.getFormatHash()['shortTime24'];
8         format = format.replace(/\s?a\s?/,"");  
9 -       Mojo.Dom.get('clock').innerHTML = Mojo.Format.formatDate(date, {time: format});                         
10 +       var suffix = "";
11 +       if(format == "h:mm"){
12 +               if(new Date().getHours() < 12) {
13 +                       suffix = " AM";
14 +               } else {
15 +                       suffix = " PM";
16 +               }
17 +       }
18 +  var prefixDate = Mojo.Format.formatDate(date, {date:'short'});
19 +  prefixDate = prefixDate.substr(0, prefixDate.lastIndexOf('/'));
20 +       Mojo.Dom.get('clock').innerHTML = prefixDate+'&nbsp;&nbsp;&nbsp;'+Mojo.Format.formatDate(date, {time: format}) + suffix;
21         Mojo.Dom.get('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
22  },
23