| 21 | } |
| 22 | |
| 23 | void Date::set(const String& date) |
| 24 | { |
| 25 | clear(); |
| 26 | |
| 27 | //check for format (german/english) |
| 28 | if (date.has('.')) |
| 29 | { |
| 30 | QDate::operator=(QDate::fromString(date.c_str(), "dd.MM.yyyy")); |
| 31 | } |
| 32 | else if (date.has('/')) |
| 33 | { |
| 34 | QDate::operator=(QDate::fromString(date.c_str(), "MM/dd/yyyy")); |
| 35 | } |
| 36 | else if (date.has('-')) |
| 37 | { |
| 38 | QDate::operator=(QDate::fromString(date.c_str(), "yyyy-MM-dd")); |
| 39 | } |
| 40 | |
| 41 | if (!isValid()) |
| 42 | { |
| 43 | throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, date, "Is no valid german, english or iso date"); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | void Date::set(UInt month, UInt day, UInt year) |
| 48 | { |