31#ifndef GNC_OPTION_DATE_HPP_
32#define GNC_OPTION_DATE_HPP_
35#include "gnc-datetime.hpp"
64 START_CURRENT_QUARTER,
76 START_ACCOUNTING_PERIOD,
77 END_ACCOUNTING_PERIOD,
80constexpr unsigned relative_date_periods =
81 static_cast<unsigned>(RelativeDatePeriod::END_ACCOUNTING_PERIOD) + 2;
83using RelativeDatePeriodVec = std::vector<RelativeDatePeriod>;
Date and Time handling routines.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
time64 gnc_relative_date_to_time64(RelativeDatePeriod, time64 now_t=static_cast< time64 >(GncDateTime()))
Convert a RelativeDatePeriod value to a concrete time64 by applying the value to the current time.
RelativeDatePeriod
Reporting periods relative to the current date.
bool gnc_relative_date_is_ending(RelativeDatePeriod)
Report whether the relative date represents the end of a date range.
bool gnc_relative_date_is_starting(RelativeDatePeriod)
Report whether the relative date represents the beginning of a date range.
const char * gnc_relative_date_display_string(RelativeDatePeriod)
Provide the string representation of a relative date for displaying value to a user.
const char * gnc_relative_date_storage_string(RelativeDatePeriod)
Provide the string representation of a relative date for persisting the value.
bool gnc_relative_date_is_single(RelativeDatePeriod)
Report whether the relative date represents a period offset to today's date rather than the beginning...
std::ostream & operator<<(std::ostream &, const RelativeDatePeriod)
Add the display string to the provided std::ostream.
const char * gnc_relative_date_description(RelativeDatePeriod)
Provide the description of a relative date.
RelativeDatePeriod gnc_relative_date_from_storage_string(const char *)
Convert a relative date storage string back to a RelativeDatePeriod value.