Merge pull request #6 from LucasCZE/patch-2

Added padding zeroes in sunrise/sunset time when using 24h format
yahoo_weather
Christian Louis Gabriel METZLER 13 years ago
commit 73575849c2
  1. 4
      src/extension.js

@ -749,9 +749,9 @@ global.log(a);
if(this._clockFormat == "24h") if(this._clockFormat == "24h")
{ {
sunrise = new Date("3 Mar 1999 "+sunrise); sunrise = new Date("3 Mar 1999 "+sunrise);
sunrise = sunrise.getHours()+":"+sunrise.getMinutes(); sunrise = sunrise.getHours()+":"+((sunrise.getMinutes()<10)?"0":"")+sunrise.getMinutes();
sunset = new Date("3 Mar 1999 "+sunset); sunset = new Date("3 Mar 1999 "+sunset);
sunset = sunset.getHours()+":"+sunset.getMinutes(); sunset = sunset.getHours()+":"+((sunset.getMinutes()<10)?"0":"")+sunset.getMinutes();
} }
this._currentWeatherIcon.icon_name = this._weatherIcon.icon_name = iconname; this._currentWeatherIcon.icon_name = this._weatherIcon.icon_name = iconname;

Loading…
Cancel
Save