GnuCash c935c2f+
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions | Variables
gnc-option-date.hpp File Reference

Relative date enumeration and manipulation functions. More...

#include "gnc-date.h"
#include "gnc-datetime.hpp"
#include <vector>
#include <iostream>

Go to the source code of this file.

Typedefs

using RelativeDatePeriodVec = std::vector< RelativeDatePeriod >
 

Enumerations

enum class  RelativeDatePeriod : int {
  ABSOLUTE = -1 , TODAY , ONE_WEEK_AGO , ONE_WEEK_AHEAD ,
  ONE_MONTH_AGO , ONE_MONTH_AHEAD , THREE_MONTHS_AGO , THREE_MONTHS_AHEAD ,
  SIX_MONTHS_AGO , SIX_MONTHS_AHEAD , ONE_YEAR_AGO , ONE_YEAR_AHEAD ,
  START_THIS_MONTH , END_THIS_MONTH , START_PREV_MONTH , END_PREV_MONTH ,
  START_NEXT_MONTH , END_NEXT_MONTH , START_CURRENT_QUARTER , END_CURRENT_QUARTER ,
  START_PREV_QUARTER , END_PREV_QUARTER , START_NEXT_QUARTER , END_NEXT_QUARTER ,
  START_CAL_YEAR , END_CAL_YEAR , START_PREV_YEAR , END_PREV_YEAR ,
  START_NEXT_YEAR , END_NEXT_YEAR , START_ACCOUNTING_PERIOD , END_ACCOUNTING_PERIOD
}
 Reporting periods relative to the current date. More...
 

Functions

bool gnc_relative_date_is_single (RelativeDatePeriod)
 Report whether the relative date represents a period offset to today's date rather than the beginning or end of a date range.
 
bool gnc_relative_date_is_starting (RelativeDatePeriod)
 Report whether the relative date represents the beginning of a date range.
 
bool gnc_relative_date_is_ending (RelativeDatePeriod)
 Report whether the relative date represents the end of a date range.
 
const char * gnc_relative_date_storage_string (RelativeDatePeriod)
 Provide the string representation of a relative date for persisting the value.
 
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_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.
 
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.
 
std::ostream & operator<< (std::ostream &, const RelativeDatePeriod)
 Add the display string to the provided std::ostream.
 

Variables

constexpr unsigned relative_date_periods
 

Detailed Description

Relative date enumeration and manipulation functions.

Author
Copyright 2019-2021 John Ralls jrall.nosp@m.s@ce.nosp@m.ridwe.nosp@m.n.us

Definition in file gnc-option-date.hpp.