Skip to content

Commit

Permalink
V2022.1.2
Browse files Browse the repository at this point in the history
- Fixed issue with date handling
  • Loading branch information
nlogozzo committed Jan 13, 2022
1 parent af9d632 commit 0392543
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion UpdateConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"LatestVersion":"2022.1.1","Changelog":"- Added support for repeating transactions\n- ID will now automatically increment starting from 1\n- Added action color to buttons","LinkToExe":"https://github.com/nlogozzo/NickvisionMoney/releases/download/2022.1.1/NickvisionMoney"}
{"LatestVersion":"2022.1.2","Changelog":"- Fixed issue with date handling","LinkToExe":"https://github.com/nlogozzo/NickvisionMoney/releases/download/2022.1.2/NickvisionMoney"}
14 changes: 7 additions & 7 deletions models/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,50 @@ namespace NickvisionMoney::Models
bool repeatNeeeded = false;
if(transaction.getRepeatInterval() == RepeatInterval::Daily)
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_days(1)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_days(1)) != -1)
{
repeatNeeeded = true;
}
}
else if(transaction.getRepeatInterval() == RepeatInterval::Weekly)
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_days(7)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_days(7)) != -1)
{
repeatNeeeded = true;
}
}
else if(transaction.getRepeatInterval() == RepeatInterval::Monthly)
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_months(1)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_months(1)) != -1)
{
repeatNeeeded = true;
}
}
else if(transaction.getRepeatInterval() == RepeatInterval::Quarterly)
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_months(4)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_months(4)) != -1)
{
repeatNeeeded = true;
}
}
else if(transaction.getRepeatInterval() == RepeatInterval::Yearly)
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_years(1)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_years(1)) != -1)
{
repeatNeeeded = true;
}
}
else
{
if(Glib::DateTime::create_now_utc().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_years(2)) != -1)
if(Glib::DateTime::create_now_local().compare(Glib::DateTime::create_from_iso8601(transaction.getDate()).add_years(2)) != -1)
{
repeatNeeeded = true;
}
}
if(repeatNeeeded)
{
Transaction newTransaction(getNextID());
newTransaction.setDate(Glib::DateTime::create_now_utc().format_iso8601());
newTransaction.setDate(Glib::DateTime::create_now_local().format_iso8601());
newTransaction.setDescription(transaction.getDescription());
newTransaction.setType(transaction.getType());
newTransaction.setRepeatInterval(transaction.getRepeatInterval());
Expand Down
6 changes: 3 additions & 3 deletions views/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NickvisionMoney::Views
using namespace NickvisionMoney::Models;
using namespace NickvisionMoney::Controls;

MainWindow::MainWindow() : m_opened(false), m_updater("https://raw.githubusercontent.com/nlogozzo/NickvisionMoney/main/UpdateConfig.json", { "2022.1.1" }), m_account(std::nullopt)
MainWindow::MainWindow() : m_opened(false), m_updater("https://raw.githubusercontent.com/nlogozzo/NickvisionMoney/main/UpdateConfig.json", { "2022.1.2" }), m_account(std::nullopt)
{
//==Settings==//
set_default_size(800, 600);
Expand Down Expand Up @@ -390,7 +390,7 @@ namespace NickvisionMoney::Views
void MainWindow::changelog(const Glib::VariantBase& args)
{
Gtk::MessageDialog* changelogDialog = new Gtk::MessageDialog(*this, "What's New?", false, Gtk::MessageType::INFO, Gtk::ButtonsType::OK, true);
changelogDialog->set_secondary_text("\n- Added support for repeating transactions\n- ID will now automatically increment starting from 1\n- Added action color to buttons");
changelogDialog->set_secondary_text("\n- Fixed issue with date handling");
changelogDialog->signal_response().connect(sigc::bind([](int response, Gtk::MessageDialog* dialog)
{
delete dialog;
Expand All @@ -405,7 +405,7 @@ namespace NickvisionMoney::Views
aboutDialog->set_modal(true);
aboutDialog->set_hide_on_close(true);
aboutDialog->set_program_name("Nickvision Money");
aboutDialog->set_version("2022.1.1");
aboutDialog->set_version("2022.1.2");
aboutDialog->set_comments("A personal finance manager.");
aboutDialog->set_copyright("(C) Nickvision 2021-2022");
aboutDialog->set_license_type(Gtk::License::GPL_3_0);
Expand Down
2 changes: 1 addition & 1 deletion views/transactiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace NickvisionMoney::Views
else
{
Transaction transaction(id);
transaction.setDate(m_calDate.get_date().format_iso8601());
transaction.setDate(m_calDate.get_date().to_local().format_iso8601());
transaction.setDescription(m_txtDescription.get_text());
transaction.setType(static_cast<TransactionType>(m_cmbType.get_active_row_number()));
transaction.setRepeatInterval(static_cast<RepeatInterval>(m_cmbRepeatInterval.get_active_row_number()));
Expand Down

0 comments on commit 0392543

Please sign in to comment.