mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-15 01:42:13 -05:00
#3167 CSV parser. Try a fallback datetime format if parsing fails
This commit is contained in:
1 parent
08f516bab4
commit
60146be146
3 files changed
+14
-1
No files matched your search
@@ -311,7 +311,14 @@ bool RifCsvUserDataParser::parseData(const AsciiDataParseOptions& parseOptions)
|
||||
if (!dt.isValid() && !parseOptions.useCustomDateTimeFormat)
|
||||
{
|
||||
// Try to match date format only
|
||||
dt = tryParseDateTime(colData.toStdString(), parseOptions.dateFormat);
|
||||
if (parseOptions.dateFormat != parseOptions.dateTimeFormat)
|
||||
{
|
||||
dt = tryParseDateTime(colData.toStdString(), parseOptions.dateFormat);
|
||||
}
|
||||
if (!dt.isValid() && !parseOptions.fallbackDateTimeFormat.isEmpty())
|
||||
{
|
||||
dt = tryParseDateTime(colData.toStdString(), parseOptions.fallbackDateTimeFormat);
|
||||
}
|
||||
}
|
||||
|
||||
if (!dt.isValid())
|
||||
|
||||
Reference in new issue
Block a user