Added input_format' array, and made formats' external.
This commit is contained in:
parent
6d7827af5a
commit
bff42f702a
2 changed files with 7 additions and 5 deletions
|
|
@ -20,7 +20,9 @@ static const int month_days[12] = {
|
||||||
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char * formats[] = {
|
char input_format[128];
|
||||||
|
|
||||||
|
const char * formats[] = {
|
||||||
"%Y/%m/%d",
|
"%Y/%m/%d",
|
||||||
"%m/%d",
|
"%m/%d",
|
||||||
"%Y.%m.%d",
|
"%Y.%m.%d",
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,12 @@ struct interval_t
|
||||||
|
|
||||||
extern std::time_t now;
|
extern std::time_t now;
|
||||||
extern int now_year;
|
extern int now_year;
|
||||||
|
extern char input_format[128];
|
||||||
|
extern const char * formats[];
|
||||||
|
|
||||||
bool parse_date_mask(const char * date_str, struct std::tm * result);
|
bool parse_date_mask(const char * date_str, struct std::tm * result);
|
||||||
|
|
||||||
bool parse_date(const char * date_str, std::time_t * result,
|
bool parse_date(const char * date_str, std::time_t * result,
|
||||||
const int year = -1);
|
const int year = -1);
|
||||||
|
|
||||||
bool quick_parse_date(const char * date_str, std::time_t * result);
|
bool quick_parse_date(const char * date_str, std::time_t * result);
|
||||||
|
|
||||||
} // namespace ledger
|
} // namespace ledger
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue