diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-13 03:12:25 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-13 03:12:25 -0400 |
commit | b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23 (patch) | |
tree | 07cf2eea21e0534c63ea7992e1bbdc489d69f418 /src | |
parent | b134a98e1e86bed00f291c1eb2b6505b4d9a6b64 (diff) | |
download | fork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.tar.gz fork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.tar.bz2 fork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.zip |
Changed the default output date format in register reports from 2008-08-13 to
08-Aug-13. This allows for the account name to be one character wider, while
the century was never significant in people's minds, whereas the change in
months between two transactions sometimes is.
Diffstat (limited to 'src')
-rw-r--r-- | src/session.cc | 13 | ||||
-rw-r--r-- | src/times.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/session.cc b/src/session.cc index fea379d6..232773dc 100644 --- a/src/session.cc +++ b/src/session.cc @@ -71,12 +71,12 @@ void release_session_context() session_t::session_t() : register_format - ("%-.10D %-.20P %-.22A %!12(print_balance(fmt_t, 12, 67)) " + ("%-.9D %-.20P %-.23A %!12(print_balance(fmt_t, 12, 67)) " "%!12(print_balance(fmt_T, 12, 80, true))\n%/" "%32|%-.22A %!12(print_balance(fmt_t, 12, 67)) " "%!12(print_balance(fmt_T, 12, 80, true))\n"), wide_register_format - ("%-.10D %-.35P %-.38A %22.108t %!22.132T\n%/" + ("%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/" "%48|%-.38A %22.108t %!22.132T\n"), print_format ("\n%d %Y%C%P\n %-34W %12o%n\n%/ %-34W %12o%n\n"), @@ -161,7 +161,12 @@ void session_t::read_init() ifstream init(*init_file); - // jww (2006-09-15): Read initialization options here! + journal_t temp(this); + if (read_journal(temp, *init_file) > 0 || + temp.auto_entries.size() > 0 || + temp.period_entries.size() > 0) + throw_(parse_error, "Entries found in initialization file '" << + init_file << "'"); } std::size_t session_t::read_data(journal_t& journal, @@ -174,6 +179,8 @@ std::size_t session_t::read_data(journal_t& journal, std::size_t entry_count = 0; + read_init(); + DEBUG("ledger.cache", "3. use_cache = " << use_cache); if (use_cache && cache_file) { diff --git a/src/times.h b/src/times.h index 306477f5..7e9d7ac0 100644 --- a/src/times.h +++ b/src/times.h @@ -95,7 +95,7 @@ inline string format_date(const date_t& when, std::strftime(buf, 255, format->c_str(), &moment); return buf; } else { - return to_iso_extended_string(when); + return to_simple_string(when).substr(2); } } |