MCPcopy Create free account
hub / github.com/KDE/labplot / isDateTime

Method isDateTime

src/3rdparty/QXlsx/source/xlsxcell.cpp:270–294  ·  view source on GitHub ↗

! * Returns whether the value is probably a dateTime or not */

Source from the content-addressed store, hash-verified

268 * Returns whether the value is probably a dateTime or not
269 */
270bool Cell::isDateTime() const
271{
272 Q_D(const Cell);
273
274 Cell::CellType cellType = d->cellType;
275 double dValue = d->value.toDouble(); // number
276// QString strValue = d->value.toString().toUtf8();
277 bool isValidFormat = d->format.isValid();
278 bool isDateTimeFormat = d->format.isDateTimeFormat(); // datetime format
279
280 // dev67
281 if ( cellType == NumberType ||
282 cellType == DateType ||
283 cellType == CustomType )
284 {
285 if ( dValue >= 0 &&
286 isValidFormat &&
287 isDateTimeFormat )
288 {
289 return true;
290 }
291 }
292
293 return false;
294}
295
296/*!
297 * Return the data time value.

Callers 2

readMethod · 0.45
readMethod · 0.45

Calls 2

isDateTimeFormatMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected