|
@@ -960,7 +960,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*data_manage.EdbDataList, latest
|
|
|
//根据数据确定最早的年份,和最近年份
|
|
|
//根据横轴的日期,汇总所有的年份
|
|
|
startDate := dataList[0].DataTime
|
|
|
- startDateT, tmpErr := time.Parse(utils.FormatDate, startDate)
|
|
|
+ startDateT, tmpErr := time.ParseInLocation(utils.FormatDate, startDate,time.Local)
|
|
|
if tmpErr != nil {
|
|
|
err = tmpErr
|
|
|
return
|
|
@@ -968,7 +968,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*data_manage.EdbDataList, latest
|
|
|
startYear := startDateT.Year()
|
|
|
//获取数据的最新日期
|
|
|
lastDate := dataList[length-1].DataTime
|
|
|
- lastDateT, tmpErr := time.Parse(utils.FormatDate, lastDate)
|
|
|
+ lastDateT, tmpErr := time.ParseInLocation(utils.FormatDate, lastDate,time.Local)
|
|
|
if tmpErr != nil {
|
|
|
err = tmpErr
|
|
|
return
|
|
@@ -994,13 +994,13 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*data_manage.EdbDataList, latest
|
|
|
name := fmt.Sprintf("%s_%s", startStr, endStr)
|
|
|
showName := fmt.Sprintf("%d_%d", currentStartYear, currentEndYear)
|
|
|
|
|
|
- startT, tEr := time.Parse(utils.FormatDate, startStr)
|
|
|
+ startT, tEr := time.ParseInLocation(utils.FormatDate, startStr,time.Local)
|
|
|
if tEr != nil {
|
|
|
err = tEr
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- endT, tEr := time.Parse(utils.FormatDate, endStr)
|
|
|
+ endT, tEr := time.ParseInLocation(utils.FormatDate, endStr,time.Local)
|
|
|
if tEr != nil {
|
|
|
err = tEr
|
|
|
return
|
|
@@ -1046,7 +1046,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*data_manage.EdbDataList, latest
|
|
|
}
|
|
|
|
|
|
for _, v := range dataList {
|
|
|
- dataTimeT, _ := time.Parse(utils.FormatDate, v.DataTime)
|
|
|
+ dataTimeT, _ := time.ParseInLocation(utils.FormatDate, v.DataTime,time.Local)
|
|
|
year := dataTimeT.Year()
|
|
|
newItemDate := dataTimeT.AddDate(nowYear-year, 0, 0)
|
|
|
for k, dateItem := range dataMap {
|
|
@@ -1061,7 +1061,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*data_manage.EdbDataList, latest
|
|
|
if jumpYear == 1 {
|
|
|
//计算前一年最大的日期, 只补齐数据到去年
|
|
|
beforeYearMaxDate := fmt.Sprintf("%d-12-31", dateItem.StartDate.Year())
|
|
|
- beforeYearMaxDateT, _ := time.Parse(utils.FormatDate, beforeYearMaxDate)
|
|
|
+ beforeYearMaxDateT, _ := time.ParseInLocation(utils.FormatDate, beforeYearMaxDate,time.Local)
|
|
|
if dataTimeT.Before(beforeYearMaxDateT) || dataTimeT == beforeYearMaxDateT {
|
|
|
newItemDate = dataTimeT.AddDate(nowYear-year-1, 0, 0)
|
|
|
} else {
|
|
@@ -1169,7 +1169,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *data_manage.EdbDataResult, late
|
|
|
//获取数据的最新日期
|
|
|
lastDate := result.List[length-1].Items[itemLength-1].DataTime
|
|
|
maxY := result.List[length-1].Year
|
|
|
- lastDateT, tmpErr := time.Parse(utils.FormatDate, lastDate)
|
|
|
+ lastDateT, tmpErr := time.ParseInLocation(utils.FormatDate, lastDate,time.Local)
|
|
|
if tmpErr != nil {
|
|
|
err = tmpErr
|
|
|
return
|
|
@@ -1196,13 +1196,13 @@ func GetSeasonEdbInfoDataListByXDateNong(result *data_manage.EdbDataResult, late
|
|
|
endStr := fmt.Sprintf("%d-%s", currentEndYear, xEndDate)
|
|
|
showName := fmt.Sprintf("%d_%d", currentStartYear, currentEndYear)
|
|
|
|
|
|
- startT, tEr := time.Parse(utils.FormatDate, startStr)
|
|
|
+ startT, tEr := time.ParseInLocation(utils.FormatDate, startStr,time.Local)
|
|
|
if tEr != nil {
|
|
|
err = tEr
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- endT, tEr := time.Parse(utils.FormatDate, endStr)
|
|
|
+ endT, tEr := time.ParseInLocation(utils.FormatDate, endStr,time.Local)
|
|
|
if tEr != nil {
|
|
|
err = tEr
|
|
|
return
|
|
@@ -1295,7 +1295,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *data_manage.EdbDataResult, late
|
|
|
DataTimestamp: item.DataTimestamp,
|
|
|
Value: item.Value,
|
|
|
}
|
|
|
- dataTimeT, _ := time.Parse(utils.FormatDate, item.DataTime)
|
|
|
+ dataTimeT, _ := time.ParseInLocation(utils.FormatDate, item.DataTime,time.Local)
|
|
|
// year := dataTimeT.Year()
|
|
|
// newItemDate := dataTimeT.AddDate(nowYear-year, 0, 0)
|
|
|
// timestamp := newItemDate.UnixNano() / 1e6
|