- TW-1522 Date format doesn't like hyphens (thanks to Scott Carter).
This commit is contained in:
Paul Beckingham
2015-01-25 14:49:02 -05:00
parent 4865269630
commit 6626207ad1
11 changed files with 30 additions and 10 deletions

View File

@@ -34,6 +34,7 @@
#include <i18n.h>
std::string Lexer::dateFormat = "";
bool Lexer::isoEnabled = true;
////////////////////////////////////////////////////////////////////////////////
Lexer::Lexer (const std::string& input)
@@ -732,15 +733,18 @@ void Lexer::dequote (std::string& input)
bool Lexer::is_date (std::string& result)
{
// Try an ISO date parse.
std::string::size_type iso_i = 0;
std::string iso_result;
ISO8601d iso;
iso.ambiguity (_ambiguity);
if (iso.parse (_input.substr (_shift_counter), iso_i))
if (isoEnabled)
{
result = _input.substr (_shift_counter, iso_i);
while (iso_i--) shift ();
return true;
std::string::size_type iso_i = 0;
std::string iso_result;
ISO8601d iso;
iso.ambiguity (_ambiguity);
if (iso.parse (_input.substr (_shift_counter), iso_i))
{
result = _input.substr (_shift_counter, iso_i);
while (iso_i--) shift ();
return true;
}
}
// Try a legacy rc.dateformat parse here.