When computing a report period, use the direct results of the parse
rather than passing back to --begin and --end.
This commit is contained in:
parent
e6c5182004
commit
27f03b9950
1 changed files with 14 additions and 2 deletions
16
config.cc
16
config.cc
|
|
@ -796,11 +796,21 @@ OPT_BEGIN(period, "p:") {
|
||||||
interval_t interval(config.report_period);
|
interval_t interval(config.report_period);
|
||||||
if (interval.begin) {
|
if (interval.begin) {
|
||||||
std::strftime(buf, 127, formats[0], std::localtime(&interval.begin));
|
std::strftime(buf, 127, formats[0], std::localtime(&interval.begin));
|
||||||
process_option(config_options, "begin", buf);
|
|
||||||
|
if (! config.predicate.empty())
|
||||||
|
config.predicate += "&";
|
||||||
|
config.predicate += "d>=[";
|
||||||
|
config.predicate += buf;
|
||||||
|
config.predicate += "]";
|
||||||
}
|
}
|
||||||
if (interval.end) {
|
if (interval.end) {
|
||||||
std::strftime(buf, 127, formats[0], std::localtime(&interval.end));
|
std::strftime(buf, 127, formats[0], std::localtime(&interval.end));
|
||||||
process_option(config_options, "end", buf);
|
|
||||||
|
if (! config.predicate.empty())
|
||||||
|
config.predicate += "&";
|
||||||
|
config.predicate += "d<[";
|
||||||
|
config.predicate += buf;
|
||||||
|
config.predicate += "]";
|
||||||
}
|
}
|
||||||
} OPT_END(period);
|
} OPT_END(period);
|
||||||
|
|
||||||
|
|
@ -893,10 +903,12 @@ OPT_BEGIN(amount_data, "j") {
|
||||||
config.format_string = config.plot_amount_format;
|
config.format_string = config.plot_amount_format;
|
||||||
} OPT_END(amount_data);
|
} OPT_END(amount_data);
|
||||||
|
|
||||||
|
|
||||||
OPT_BEGIN(total_data, "J") {
|
OPT_BEGIN(total_data, "J") {
|
||||||
config.format_string = config.plot_total_format;
|
config.format_string = config.plot_total_format;
|
||||||
} OPT_END(total_data);
|
} OPT_END(total_data);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Commodity reporting
|
// Commodity reporting
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue