/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Date.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/01/16 18:06:10 by bchanot #+# #+# */ /* Updated: 2026/01/16 19:34:38 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "Date.hpp" bool operator<(const Date &a, const Date &b) { if (a.year != b.year) return a.year < b.year; if (a.month != b.month) return a.month < b.month; return a.day < b.day; } bool operator==(const Date &a, const Date &b) { return a.year == b.year && a.month == b.month && a.day == b.day; } bool operator!=(const Date &a, const Date &b) { return !(a == b); } std::ostream &operator<<(std::ostream &o, const Date &date) { o << date.year << "-" << std::setw(2) << std::setfill('0') << date.month << "-" << std::setw(2) << std::setfill('0') << date.day << std::setfill(' ');; return o; }