Skip to content

Commit

Permalink
Fixed time zone issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Oct 6, 2024
1 parent f687f04 commit 8657e54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## 1.7.1

- 💊 Fixed time zone issues

## 1.7.0

- 🎁 Added support for [Aviation Weather Center](https://aviationweather.gov/) and date property
Expand Down
8 changes: 4 additions & 4 deletions src/WettergeraetDesktop/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Frame::Frame(const wxString& title, int argc, char * argv[]) : wxFrame(nullptr,
wxStaticText *utcTimeLabel = new wxStaticText(panel, wxID_ANY, wxT("Time (UTC)"));
hbox3->Add(utcTimeLabel, 1, wxRIGHT | wxALIGN_CENTER_VERTICAL, labelBorder);

wxDateTime utcDateValue = wxDateTime::Now();
wxDateTime utcDateValue = wxDateTime::Now().MakeUTC();
this->utcTimeInput = new wxTimePickerCtrl(panel, Frame::EL_CTRL_DATETIME, utcDateValue);
hbox3->Add(this->utcTimeInput, 1, wxALIGN_CENTER_VERTICAL);

Expand Down Expand Up @@ -442,11 +442,11 @@ void Frame::actionFetch(wxCommandEvent& WXUNUSED(event))
auto time = this->utcTimeInput->GetValue();
auto hour = time.GetHour();
auto minute = time.GetMinute();
auto second = time.GetSecond();

// 2024-10-06T15%3A00%3A01Z
// yyyymmdd_hhmmZ
// yyyy-mm-ddThh:mm:ssZ
char searchDate[25];
sprintf(searchDate, "%04d-%02d-%02dT%02d:%02d:%02dZ", year, month, day, hour, minute, second);
sprintf(searchDate, "%04d%02d%02d_%02d%02dZ", year, month, day, hour, minute);

this->metarInput->SetValue("Loading...");
FetchUrl urlFetcher;
Expand Down
2 changes: 1 addition & 1 deletion src/WettergeraetLib/Argumentor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <sstream>
#include <iterator>

const char* Argumentor::APP_VERSION = "1.7.0";
const char* Argumentor::APP_VERSION = "1.7.1";
#if _WIN64
const char* Argumentor::APP_TARGET = "64-bit";
#else
Expand Down
5 changes: 0 additions & 5 deletions src/WettergeraetLib/FetchUrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ std::string FetchUrl::fetch(std::string url, std::string icaoCode, std::string d
std::regex("[^a-zA-z0-9]"),
""
);
date = std::regex_replace(
date,
std::regex("[:]"),
"%3A"
);
if (lowercase) {
transform(icaoCode.begin(), icaoCode.end(), icaoCode.begin(), ::tolower);
}
Expand Down

0 comments on commit 8657e54

Please sign in to comment.