diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-03-23 10:54:14 +0100 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-03-25 09:42:40 +0100 |
commit | ea61644abe9e7cd35cdb54452dac327782bbc402 (patch) | |
tree | 0bec03e2b405c54060d3c4425bad7e6428f83559 /include | |
parent | 89af24074e9adac4d005dcc322d81db09fc19f54 (diff) |
tdf#58745 - Detect end of month when extending a date list
Change-Id: Icaa64a493598dc4bb8f2d6d076ad4300e2e4dde6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112976
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/date.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/tools/date.hxx b/include/tools/date.hxx index cd69d16b10b6..6179d637e8ba 100644 --- a/include/tools/date.hxx +++ b/include/tools/date.hxx @@ -188,6 +188,9 @@ public: depending on month/year) */ bool IsValidDate() const; + // Returns true, if the date is the end of the month, false otherwise. + bool IsEndOfMonth() const; + /** Normalize date, invalid day or month values are adapted such that they carry over to the next month or/and year, for example 1999-02-32 becomes 1999-03-04, 1999-13-01 becomes 2000-01-01, 1999-13-42 becomes @@ -239,6 +242,8 @@ public: static sal_Int32 DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ); /// Semantically identical to IsValidDate() member method. static bool IsValidDate( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ); + /// Semantically identical to IsEndOfMonth() member method. + static bool IsEndOfMonth(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear); /// Semantically identical to Normalize() member method. static bool Normalize( sal_uInt16 & rDay, sal_uInt16 & rMonth, sal_Int16 & rYear ); |