diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp index 85f8a4b882..b0e2206a84 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp @@ -19,6 +19,7 @@ #include "RimWellPlotTools.h" #include "RiaApplication.h" +#include "RiaQDateTimeTools.h" #include "RiaWellNameComparer.h" #include "RifReaderEclipseRft.h" @@ -31,6 +32,7 @@ #include "RimEclipseResultCase.h" #include "RimOilField.h" #include "RimProject.h" +#include "RimTools.h" #include "RimWellLogExtractionCurve.h" #include "RimWellLogFile.h" #include "RimWellLogFileChannel.h" @@ -39,7 +41,6 @@ #include "RimWellPath.h" #include "RimWellPathCollection.h" -#include "RimTools.h" #include //-------------------------------------------------------------------------------------------------- @@ -986,7 +987,8 @@ void RimWellPlotTools::calculateValueOptionsForTimeSteps( for (const std::pair>& timeStepPair : timestepsToShowWithSources) { - QString optionText = timeStepPair.first.toString(dateFormatString); + QString optionText = RiaQDateTimeTools::toStringUsingApplicationLocale(timeStepPair.first, dateFormatString); + bool hasObs = false; bool hasRft = false; bool hasGrid = false; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index cfdf972cdb..cbe735d51c 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -21,6 +21,7 @@ #include "RiaApplication.h" #include "RiaColorTables.h" #include "RiaDateStringParser.h" +#include "RiaQDateTimeTools.h" #include "RiaWellNameComparer.h" #include "RifReaderEclipseRft.h" @@ -528,7 +529,8 @@ void RimWellPltPlot::syncCurvesFromUiSelection() curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : ""; curveName += sourceDef.wellLogFile() ? sourceDef.wellLogFile()->name() : ""; if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT ) curveName += ", RFT"; - curveName += ", " + timeStep.toString(dateFormatString); + + curveName += ", " + RiaQDateTimeTools::toStringUsingApplicationLocale(timeStep, dateFormatString); } RimEclipseResultCase* rimEclipseResultCase = dynamic_cast(sourceDef.eclCase()); diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index bc2b30589f..e2c43a8f1f 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -20,6 +20,8 @@ #include "Rim3dOverlayInfoConfig.h" +#include "RiaQDateTimeTools.h" + #include "RicGridStatisticsDialog.h" #include "RigCaseCellResultsData.h" @@ -899,9 +901,12 @@ QString Rim3dOverlayInfoConfig::timeStepText(RimEclipseView* eclipseView) if (currTimeStepIndex >= 0 && currTimeStepIndex < (int)timeSteps.size()) { QString dateFormat = RimTools::createTimeFormatStringFromDates(timeSteps); + + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(timeSteps[currTimeStepIndex], dateFormat); + dateTimeString = QString("Time Step: %1/%2 %3").arg(QString::number(currTimeStepIndex), QString::number(timeSteps.size() - 1), - timeSteps[currTimeStepIndex].toString(dateFormat)); + dateString); } return QString("

-- %1 --
").arg(dateTimeString) + diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp index b1a4380880..48e319403c 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp @@ -18,7 +18,10 @@ #include "Rim3dWellLogRftCurve.h" +#include "RiaQDateTimeTools.h" + #include "RifReaderEclipseRft.h" + #include "RigWellLogCurveData.h" #include "RimWellLogRftCurveNameConfig.h" @@ -191,7 +194,9 @@ QList Rim3dWellLogRftCurve::calculateValueOptions(const std::vector timeStamps = reader->availableTimeSteps(wellName(), m_wellLogChannelName()); for (const QDateTime& dt : timeStamps) { - options.push_back(caf::PdmOptionItemInfo(dt.toString(dateFormat), dt)); + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(dt, dateFormat); + + options.push_back(caf::PdmOptionItemInfo(dateString, dt)); } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index bc7c62f522..78fd512799 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -851,8 +851,10 @@ QString RimEclipseCase::timeStepName(int frameIdx) const if (frameIdx < static_cast(timeStepDates.size())) { QDateTime date = timeStepDates.at(frameIdx); - return date.toString(m_timeStepFormatString); + + return RiaQDateTimeTools::toStringUsingApplicationLocale(date, m_timeStepFormatString); } + return QString(""); } diff --git a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp index 3d6529564d..eeeb6ce0a8 100644 --- a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp +++ b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp @@ -18,7 +18,10 @@ #include "RimTimeStepFilter.h" +#include "RiaQDateTimeTools.h" + #include "RifReaderEclipseOutput.h" + #include "RigCaseCellResultsData.h" #include "RimEclipseResultCase.h" @@ -91,10 +94,13 @@ RimTimeStepFilter::RimTimeStepFilter() void RimTimeStepFilter::setTimeStepsFromFile(const std::vector& timeSteps) { m_dateFormat = RimTools::createTimeFormatStringFromDates(timeSteps); + std::vector timeStepStrings; for (const QDateTime& date : timeSteps) { - timeStepStrings.push_back(date.toString(m_dateFormat)); + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(date, m_dateFormat); + + timeStepStrings.push_back(dateString); } m_timeStepNamesFromFile = timeStepStrings; @@ -128,7 +134,7 @@ void RimTimeStepFilter::setTimeStepsFromFile(const std::vector RimWellLogRftCurve::calculateValueOptions(const ca std::vector timeStamps = reader->availableTimeSteps(m_wellName, m_wellLogChannelName()); for (const QDateTime& dt : timeStamps) { - options.push_back(caf::PdmOptionItemInfo(dt.toString(dateFormat), dt)); + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(dt, dateFormat); + + options.push_back(caf::PdmOptionItemInfo(dateString, dt)); } } diff --git a/ApplicationCode/UserInterface/RiuQwtCurvePointTracker.cpp b/ApplicationCode/UserInterface/RiuQwtCurvePointTracker.cpp index bb9c108bd4..d8a4922df8 100644 --- a/ApplicationCode/UserInterface/RiuQwtCurvePointTracker.cpp +++ b/ApplicationCode/UserInterface/RiuQwtCurvePointTracker.cpp @@ -18,6 +18,8 @@ #include "RiuQwtCurvePointTracker.h" +#include "RiaQDateTimeTools.h" + #include "qwt_plot_marker.h" #include "qwt_symbol.h" @@ -176,7 +178,9 @@ QPointF RiuQwtCurvePointTracker::closestCurvePoint(const QPoint& cursorPosition, if ( dateScaleDraw ) { QDateTime date = dateScaleDraw->toDateTime(mainAxisSampleVal); - *mainAxisValueString = date.toString("hh:mm dd.MMMM.yyyy"); + + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(date, "hh:mm dd.MMMM.yyyy"); + *mainAxisValueString = dateString; } else if ( mainAxisScaleDraw ) { diff --git a/ApplicationCode/UserInterface/RiuResultQwtPlot.cpp b/ApplicationCode/UserInterface/RiuResultQwtPlot.cpp index 6ed8ef30eb..e844873ff4 100644 --- a/ApplicationCode/UserInterface/RiuResultQwtPlot.cpp +++ b/ApplicationCode/UserInterface/RiuResultQwtPlot.cpp @@ -20,6 +20,7 @@ #include "RiuResultQwtPlot.h" #include "RiaCurveDataTools.h" +#include "RiaQDateTimeTools.h" #include "RimContextCommandBuilder.h" #include "RimCase.h" @@ -214,7 +215,10 @@ QString RiuResultQwtPlot::asciiDataForUiSelectedCurves() const } } out += "\n"; - out += m_timeSteps.at(caseId)[i].toString("yyyy-MM-dd hh:mm:ss "); + + QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(m_timeSteps.at(caseId)[i], "yyyy-MM-dd hh:mm:ss "); + + out += dateString; for (size_t j = 0; j < m_curveData.at(caseId).size(); j++) // curves {