Hacker News new | ask | show | jobs
by jamiesonbecker 4115 days ago
Looks fantastic. It did take a few minutes to get forked over and modify for location, °F instead of °C, etc. Perhaps a future version could use a config.js or something that would just swap those.

For the record, you want to edit js/scripts/controllers.js and js/scripts/view/dashboard.html.

Replacing Helsinki in the openweathermap.org link with your plain text city name seems to work.

For Fahrenheit, replace the "var temp" line in controllers.js with:

    var temp = Math.round(((parseInt(data.main.temp) - 273.15) * 9/5) + 32, 2) + "°F";
I didn't get the github.io pages working in less than a few minutes, so I just grabbed it locally where it'll probably work faster anyway. Thanks also for the great plugin link. Excellent work Jakke, beautiful typography.
1 comments

Similarly, if you prefer the American date format you can change the two $scope.text lines near the end of controllers.js to

  $scope.text = "Good " + $scope.getStateOfDay(moment().get('hour')) + ", today is " + moment().format('dddd MM/DD/YYYY') + ".";
which looks like 'Thursday 03/12/2015'; or you can change both lines to

  $scope.text = "Good " + $scope.getStateOfDay(moment().get('hour')) + ", today is " + moment().format('dddd, MMMM DD, YYYY') + ".";
which looks like 'Thursday, March 12, 2015'.