! * Returns whether the value is probably a dateTime or not */
| 268 | * Returns whether the value is probably a dateTime or not |
| 269 | */ |
| 270 | bool 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. |
no test coverage detected