1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

fixed selected month

This commit is contained in:
2016-06-01 17:56:48 -05:00
parent b92b2f0111
commit 759eff9109
2 changed files with 7 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ func (s *Data) StoreData() error {
return nil
}
//function to update the daily temperature max or min for a location
func (s *Data) UpdateData() error {
if db.Mongo.Connected() {
@@ -85,6 +86,8 @@ func (s *Data) UpdateData() error {
}
//get the current daily sensor reading to compare
//if the max or min temp needs to be updated
func GetDailySensorInfo(sensor_location string) (Data, error) {
d := Data{}
@@ -143,6 +146,8 @@ func GetAllSensorInfo(sensor_location string) ([]Data, error) {
}
}
//return all daily temperature readings per year for a location
//sort by most recent year and oldest month
func GetAllSensorInfoByYear(sensor_location string, year int) ([]Data, error) {
d := []Data{}
@@ -168,6 +173,7 @@ func GetAllSensorInfoByYear(sensor_location string, year int) ([]Data, error) {
}
}
//return all temperature readings for a specific month and location
func GetAllSensorInfoByMonth(sensor_location string, year int, monthname string) ([]Data, error) {
d := []Data{}

View File

@@ -10,7 +10,7 @@ app.controller('SensorInfoController', function($scope, $http, $routeParams) {
if ($scope.list.length > 0) {
$scope.selectedObject = $scope.list[0];
$scope.selectedMonth = $scope.list[0].months[0];
$scope.selectedMonth = $scope.list[0].months[$scope.list.months.length];
$scope.loadingMonth = true;
$scope.loadingYear = true;