Commit a051589 1 parent 3454be1 commit a051589 Copy full SHA for a051589
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ async function downloadWindData(stationId: number) {
44
44
const latestEntryTimestamp = stationStats . value ?. latestEntryTimestamp || 0 ;
45
45
46
46
const newTableData = data . tableData . filter (
47
- ( entry ) => new Date ( entry . obsTimeLocal ) . getTime ( ) > latestEntryTimestamp
47
+ ( entry ) =>
48
+ parseObsTimeLocal ( entry . obsTimeLocal ) . getTime ( ) >
49
+ latestEntryTimestamp
48
50
) ;
49
51
50
52
if ( newTableData . length ) {
@@ -59,7 +61,7 @@ async function downloadWindData(stationId: number) {
59
61
transaction . set ( [ "station" , data . station . id ] , {
60
62
...data . station ,
61
63
entries : ( stationStats . value ?. entries ?? 0 ) + newTableData . length ,
62
- latestEntryTimestamp : new Date (
64
+ latestEntryTimestamp : parseObsTimeLocal (
63
65
newTableData [ 0 ] . obsTimeLocal
64
66
) . getTime ( ) ,
65
67
} ) ;
@@ -78,6 +80,10 @@ async function downloadWindData(stationId: number) {
78
80
}
79
81
}
80
82
83
+ function parseObsTimeLocal ( obsTimeLocal : string ) : Date {
84
+ return new Date ( obsTimeLocal + "+02:00" ) ;
85
+ }
86
+
81
87
const router = new Router ( ) ;
82
88
83
89
router . post ( "/login" , async ( ctx ) => {
You can’t perform that action at this time.
0 commit comments