Add formatting for Period class

This commit is contained in:
Martchus 2017-12-03 14:55:49 +01:00
parent 26cd303422
commit 46e9d4b1e4
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#define CHRONO_FORMAT_H
#include "./datetime.h"
#include "./period.h"
#include <ostream>
@ -15,4 +16,9 @@ inline std::ostream &operator<<(std::ostream &out, const ChronoUtilities::TimeSp
return out << value.toString(ChronoUtilities::TimeSpanOutputFormat::Normal, false);
}
inline std::ostream &operator<<(std::ostream &out, const ChronoUtilities::Period &value)
{
return out << value.years() << " years, " << value.months() << " months, " << value.days() << " days";
}
#endif // CHRONO_FORMAT_H