diff options
Diffstat (limited to 'src/times.cc')
-rw-r--r-- | src/times.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/times.cc b/src/times.cc index b1cb3494..b6c15dc3 100644 --- a/src/times.cc +++ b/src/times.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2013, John Wiegley. All rights reserved. + * Copyright (c) 2003-2015, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -839,6 +839,16 @@ void date_parser_t::determine_when(date_parser_t::lexer_t::token_t& tok, specifier.month = date_specifier_t::month_type (boost::get<date_time::months_of_year>(*tok.value)); + tok = lexer.peek_token(); + switch (tok.kind) { + case lexer_t::token_t::TOK_A_YEAR: + specifier.year = boost::get<date_specifier_t::year_type>(*tok.value); + break; + case lexer_t::token_t::END_REACHED: + break; + default: + break; + } break; case lexer_t::token_t::TOK_A_WDAY: specifier.wday = @@ -1802,6 +1812,7 @@ void times_initialize() readers.push_back(shared_ptr<date_io_t>(new date_io_t("%Y/%m/%d", true))); readers.push_back(shared_ptr<date_io_t>(new date_io_t("%Y/%m", true))); readers.push_back(shared_ptr<date_io_t>(new date_io_t("%y/%m/%d", true))); + readers.push_back(shared_ptr<date_io_t>(new date_io_t("%Y-%m-%d", true))); is_initialized = true; } |