Forums >Suggestions and Feature Requests>Simpler Duration entry
Good Bad & The Monkey
I'm running somewhere tomorrow. It's going to be beautiful. I can't wait.
Poor baby
Sorry, I went looking, but I managed to miss that. I'll address the one complication that I see below.
Gandalf the Grey
Well, I wrote it in java (using int convertTime(String duration, Double distance) ), but I kept finding places where the right thing to do involves something happening on the page, using, I'd assume, javascript. IE, I'd say that when there's a valid parsing, it should be shown on the page, in black, in the canonical form, next to the entry box so that the user knows it's right. Kind of like how you give Pace already. When the user doesn't enter a distance, it simply falls back to what's there now (except that it will accept "6:", or "2::"). Then there's two classes of error. To my mind, both should put something in bold red next to the entry box so the user knows something is wrong. When there is no rational parsing (say 5 miles run in "6:0"), the user should see "0:06:00" in red. When parsing is not possible (say "1:0:0:4", or "hour"), the user should see "Can't understand "+string in red. I tried to make it always possible to simply fill in to the right to get the canonical form, so if you went a mile in 8 hours, you can simply add "::" to the end (because "8" or "8:" will translate to 8 minutes) , but if someone really thinks that they ran 5 miles in 40 seconds, this will prevent them from entering that... How should I get you the code? Should I just post it here? The parser is about 200 lines (though most of that is comment or whitespace), and the excuse for a tester is around 100. Be well. And thanks, this was interesting.
Running ... just keep running!