Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a complete working version that builds on drafts #1205, #1208. It eliminates the use of strptime/strftime.
There are two parts to this problem:
For the front end we accept the following format specifiers: yy, yyyy, M, MM, d, dd, h, hh, H, HH, m, mm, s, ss, xx, XX. These are interpreted as QDate and QTime would except xx=>ap and XX=>AP. punctuation, with the exception of a single quote, and spaces may be used as well. A repeated single quote is interpreted as a single quote. Other characters must be quoted with single quotes. A repeated single quote can also be used within single quotes to represent a single quote.
The users are garmin_txt (from and to string), the track filter title option (to string), and xcsv read/write (from and to string). The title option requires arbitrary text, hence all the quote handling.
The back end has some quirks.
Alternatives: For the front end we could define our format to use strptime/strftime type conversions specifiers, i.e. where each starts with a %. For the back end we might be able to use std::get_time, std::put_time instead of QDateTime::fromString,, toString. The backend choice of put_time/get_time might positively impact some of the quirks. The frontend choice of % specifiers might be easier to parse, but seems less "human". However, the present implementation does seem to adequately covert the requirements.
None of these handle fractional seconds.
TODO: