diff --git a/src/libqof/qof/gnc-date.cpp b/src/libqof/qof/gnc-date.cpp index 52f1d51f47..9bb5b1d175 100644 --- a/src/libqof/qof/gnc-date.cpp +++ b/src/libqof/qof/gnc-date.cpp @@ -1400,7 +1400,7 @@ GDate* gnc_g_date_new_today () { GncDate gncd; gncd.today(); - auto ymd = gncd.ymd(); + auto ymd = gncd.year_month_day(); auto month = static_cast(ymd.month); auto result = g_date_new_dmy (ymd.day, month, ymd.year); g_assert(g_date_valid (result)); diff --git a/src/libqof/qof/gnc-datetime.cpp b/src/libqof/qof/gnc-datetime.cpp index db54d88bcf..7f8a6d4f03 100644 --- a/src/libqof/qof/gnc-datetime.cpp +++ b/src/libqof/qof/gnc-datetime.cpp @@ -64,13 +64,13 @@ public: GncDateImpl(Date d) : m_greg(d) {} void today() { m_greg = boost::gregorian::day_clock::local_day(); } - ymd ymd() const; + ymd year_month_day() const; private: Date m_greg; }; ymd -GncDateImpl::ymd() const +GncDateImpl::year_month_day() const { auto boost_ymd = m_greg.year_month_day(); return {boost_ymd.year, boost_ymd.month.as_number(), boost_ymd.day}; @@ -229,9 +229,9 @@ GncDate::today() } ymd -GncDate::ymd() const +GncDate::year_month_day() const { - return m_impl->ymd(); + return m_impl->year_month_day(); } GncDateTime::GncDateTime() : m_impl(new GncDateTimeImpl) {} diff --git a/src/libqof/qof/gnc-datetime.hpp b/src/libqof/qof/gnc-datetime.hpp index 31278045f0..04d48b5f34 100644 --- a/src/libqof/qof/gnc-datetime.hpp +++ b/src/libqof/qof/gnc-datetime.hpp @@ -68,7 +68,7 @@ public:/** Construct a GncDate representing the current day. /** Get the year, month, and day from the date as a ymd. @return ymd struct */ - ymd ymd() const; + ymd year_month_day() const; /** Test that the Date has an implementation. */ bool isnull (void) { return m_impl == nullptr; } diff --git a/src/libqof/qof/test/gtest-gnc-datetime.cpp b/src/libqof/qof/test/gtest-gnc-datetime.cpp index da47b0c2c1..2f6e000962 100644 --- a/src/libqof/qof/test/gtest-gnc-datetime.cpp +++ b/src/libqof/qof/test/gtest-gnc-datetime.cpp @@ -77,12 +77,12 @@ TEST(gnc_datetime_functions, test_format) EXPECT_EQ(atime.format("%d-%m-%Y"), "13-11-2045"); } -//This is a bit convoluted because it uses GncDate's GncDateImpl constructor and ymd() function. There's no good way to test the former without violating the privacy of the implementation. +//This is a bit convoluted because it uses GncDate's GncDateImpl constructor and year_month_day() function. There's no good way to test the former without violating the privacy of the implementation. TEST(gnc_datetime_functions, test_date) { GncDateTime atime(2394187200); //2045-11-13 12:00:00 Z GncDate gncd = std::move(atime.date()); - auto ymd = gncd.ymd(); + auto ymd = gncd.year_month_day(); EXPECT_EQ(ymd.year, 2045); EXPECT_EQ(ymd.month, 11); EXPECT_EQ(ymd.day, 13);