| 69 | } |
| 70 | |
| 71 | [[nodiscard]] int ParseRegistrationDate(const QString &text) { |
| 72 | // MM.YYYY |
| 73 | if (text.size() != 7 || text[2] != '.') { |
| 74 | return 0; |
| 75 | } |
| 76 | const auto month = text.mid(0, 2).toInt(); |
| 77 | const auto year = text.mid(3, 4).toInt(); |
| 78 | return (year > 2012 && year < 2100 && month > 0 && month <= 12) |
| 79 | ? (year * 100) + month |
| 80 | : 0; |
| 81 | } |
| 82 | |
| 83 | [[nodiscard]] int RegistrationYear(int date) { |
| 84 | const auto year = date / 100; |