pond / trackrecord

TrackRecord is a Ruby On Rails application which lets users enter and analyse timesheets, based around a framework of customers, projects and tasks. It may be useful for sole traders and small businesses.
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

Time calculator and formats (maybe two tickets here) #28

Open sarev opened 10 years ago

sarev commented 10 years ago

Something which would be nifty as a new feature (even if this is massive feature creep) would be a time calculator for when you need to put something in for a task but figuring it out is fiddly.

E.g. 18:37 - 09:28

One thing (which may or may not be related) that I've noticed in another timesheet system is that you can enter either "6.25" or "6:15" forms - dot vs colon separator. It happens to force the answer to colon notation once you hit enter or move focus out of the cell - I expect TR would use dot notation as its default (as usual).

Maybe the latter feature could be a per-user option, because I know many folks will tend to think in HH:MM rather than our hours . fractions.

pond commented 10 years ago

Interesting idea to accept HH:MM style as well as 'integer.fraction', except for the ambiguities introduced if a user tried "HH.MM" because of their nationality (or any other format for that reason), or just accidentally. It could be a per-user option but I can still see users getting it wrong...

There's then the question of how far you extend this. Consider all the places where numbers are displayed or parsed - should it show HH:MM or fractions everywhere, including reports? Durations on tasks? CSV exports? It's a bit of a minefield to allow multiple representations. You'd really have to be ruthlessly consistent I think, applying that format at all times, which is a fair bit of code with an obvious performance implication (even though some of the display code for the current format is centralised, which would help at least on the implementation side, if not the performance side). It also creates accuracy in representation headaches, since 2 hours and 20 minutes expressed as "2:20" looks nice and neat, but "2.3333333333333..." less so!

On time calculation - is something like this any good, or too clumsy?

http://www.scottseverance.us/html/time_calculator.htm

pond commented 10 years ago

Splitting this.

The ticket herein tracks the idea of making it user-configurable to allow fractions input in the timesheet editor grid, HH:MM input into the grid, or a mixture auto-detected based on separator. I18n issues therein might make this untenable; see issue #33; unless it was just hard-coded to "." or ":" (which is very wrong for fractions, but I suspect it's hard-coded to "." anyway within at least the JavaScript layer as JS i18n support is dreadful).

See also Issue #34.