* There has been a great deal of anguish over the encoding of
weekdays: whether [0, 6] maps to [Sunday, Saturday] or
[1, 7] maps to [Monday, Sunday]. This commit attempts
to address that issue, but will break a small amount of
code at compile-time. See below on how to fix that.
* The weekday constructor used to accept [0, 6] to represent
[Sunday, Saturday]. It now accepts [0, 7] to represent
[Sunday, Saturday] with both 0 and 7 mapping to Sunday.
* The conversion from weekday to unsigned has been removed.
* To convert a weekday to unsigned replace:
auto u = unsigned{wd};
with:
auto u = (wd - Sunday).count();
This maps [Sunday, Saturday] to [0, 6], which is the
C/POSIX mapping. If you prefer the ISO mapping
([Monday, Sunday] -> [1, 7]), then do:
auto u = (wd - Monday).count() + 1;
* Added new overloads for operator+/- between year_month and duration
that is convertible to years, so it is better candidate for operands
that are convertible to both years and months. To preserve
functionality, this operator is conditionally noexcept.
* Reworked year_month_day, year_month_day_last, year_month_weekday,
and year_month_weekday_last.
* Added tests for this new functionality.
* to_stream and from_stream now reset the stream formatting state to
default settings on entry, and restore the stream state on exit.
* to_stream and from_stream now correctly handle mis-modified flags.
* Fix %h to be equivalent to %b instead of %B.
* This addresses issues 319, 320 and 321.
* The standardized version of this library has std::chrono::January
and std::chrono::Sunday in place of std::chrono_literals::jan and
std::chrono_literals::sun. Compatible names added to namespace
date to ease transition from this lib to std::chrono. The old
names are retained for backwards compatibility.
Linux distributions use lib, lib32, and lib64 directories for library files,
symlinking them where needed. Let's follow distirbution rules by
utilising CMake module GNUInstallDirs.
The include in tz.cpp was changed to only include the ios.h header
when compiling on apple platforms, as the documentation states that
only the four files date.h, tz.h, tz_private.h, and tz.cpp should be
required to use the time zone library.
Additionally, the ios.mm file was moved to src/ since it contains
C++ source code.
Also, fix the formatting in the generator expressions. For some reason, the previous
formatting caused this error:
Target "date_interface" INTERFACE_INCLUDE_DIRECTORIES property contains
path:
...
which is prefixed in the source directory.