Add formatting for Period class
This commit is contained in:
parent
26cd303422
commit
46e9d4b1e4
|
@ -2,6 +2,7 @@
|
||||||
#define CHRONO_FORMAT_H
|
#define CHRONO_FORMAT_H
|
||||||
|
|
||||||
#include "./datetime.h"
|
#include "./datetime.h"
|
||||||
|
#include "./period.h"
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
@ -15,4 +16,9 @@ inline std::ostream &operator<<(std::ostream &out, const ChronoUtilities::TimeSp
|
||||||
return out << value.toString(ChronoUtilities::TimeSpanOutputFormat::Normal, false);
|
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
|
#endif // CHRONO_FORMAT_H
|
||||||
|
|
Loading…
Reference in New Issue