[gnote] Switch inserttimestamp from sharp::DateTime to Glib::DateTime



commit d32613a976103f4361417757a312e63ef4c7fc8b
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Wed Jan 22 22:34:56 2020 +0200

    Switch inserttimestamp from sharp::DateTime to Glib::DateTime

 src/addins/inserttimestamp/inserttimestampnoteaddin.cpp   | 4 ++--
 src/addins/inserttimestamp/inserttimestamppreferences.cpp | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp 
b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
index 45254a1b..35d28951 100644
--- a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
+++ b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2010-2013,2016-2017,2019 Aurimas Cernius
+ * Copyright (C) 2010-2013,2016-2017,2019-2020 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -73,7 +73,7 @@ namespace inserttimestamp {
 
   void InsertTimestampNoteAddin::on_menu_item_activated(const Glib::VariantBase&)
   {
-    Glib::ustring text = sharp::DateTime::now().to_string(m_date_format);
+    Glib::ustring text = sharp::date_time_to_string(Glib::DateTime::create_now_local(), m_date_format);
     Gtk::TextIter cursor = get_buffer()->get_iter_at_mark (get_buffer()->get_insert());
     std::vector<Glib::ustring> names;
     names.push_back("datetime");
diff --git a/src/addins/inserttimestamp/inserttimestamppreferences.cpp 
b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
index f895b8aa..4393d13a 100644
--- a/src/addins/inserttimestamp/inserttimestamppreferences.cpp
+++ b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2013,2017,2019 Aurimas Cernius
+ * Copyright (C) 2011-2013,2017,2019-2020 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -61,7 +61,7 @@ namespace inserttimestamp {
     Glib::RefPtr<Gio::Settings> settings = preferences.get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
     Glib::ustring dateFormat = settings->get_string(INSERT_TIMESTAMP_FORMAT);
 
-    sharp::DateTime now = sharp::DateTime::now();
+    auto now = Glib::DateTime::create_now_local();
 
     // Label
     Gtk::Label *label = manage(new Gtk::Label (_("Choose one of the predefined formats "
@@ -81,7 +81,7 @@ namespace inserttimestamp {
 
     for(auto format : s_formats) {
       Gtk::TreeIter treeiter = store->append();
-      treeiter->set_value(0, now.to_string(format));
+      treeiter->set_value(0, sharp::date_time_to_string(now, format));
       treeiter->set_value(1, format);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]