Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support addition of time (hh:mm) column #45

Closed
ebdavison opened this issue Apr 8, 2022 · 4 comments
Closed

Feature Request: Support addition of time (hh:mm) column #45

ebdavison opened this issue Apr 8, 2022 · 4 comments

Comments

@ebdavison
Copy link

ebdavison commented Apr 8, 2022

With a table that contains hours and minutes in a columns, e.g.

| what      | from  | to    | total |
| --------- | ----- | ----- | ----- |
| first     | 18:30 | 19:00 | 0:30  |
| second    | 09:05 | 09:15 | 0:10  |
| third     | 12:30 | 12:45 | 0:15  |
| **total** |       |       | 0:55  | 

It would be great if we could get:
a) calculate the total column by subtracting to - from and show it in total
b) to add up the total column to show in the last **total** row

@ebdavison
Copy link
Author

ebdavison commented Apr 8, 2022

Right now, as it is, the formula to add up the last column (<!-- TBLFM: @>$4=sum(@I..@-1) -->) results in 0 which seems only add the part before the : as you can see here:

| what      | from  | to    | total | h   | m   |
| --------- | ----- | ----- | ----- | --- | --- |
| first     | 18:30 | 19:00 | 0:30  | 0   | 30  |
| second    | 09:05 | 09:15 | 0:10  | 0   | 10  |
| fourth    | 15:30 | 14:45 | 1:15  | 0   | 15  |
| third     | 12:30 | 12:45 | 0:15  | 0   | 15  |
| **total** |       |       | 1     | 0   | 70  |
<!-- TBLFM: @>$4=sum(@I..@-1) -->

@ebdavison ebdavison changed the title Feature Request: Support adding time Feature Request: Support addition of time (hh:mm) column Apr 21, 2022
@rachelseabrook
Copy link

rachelseabrook commented Nov 16, 2022

I'd like to add my voice to the requests for time calculations. I'm using advanced tables for time planning: I have a list of tasks with estimated durations and columns for start time and stop time. At any point in the day I can enter 'now' into the stop time columns and recalculate start times for all of the subsequent tasks. I can shuffle tasks or add new ones and recalculate at any point. There's an additional column with a simple flag for fixed time tasks, i.e. appointments, and the start times of these don't get moved. I currently have two columns for each time, hours and minutes.

Example, taken shortly after 9:40, when two stop times had been entered and start times recalculated:

| task              | start h | start m | stop h | stop m | dur m | fix |
| ----------------- | ------- | ------- | ------ | ------ | ----- | --- |
| make tea          | ------- | 0       | 7      | 54     |       |     |
| morning pages     | 7       | 54      |        |        | 90    |     |
| plan day          | 9       | 24      | 9      | 40     | 20    |     |
| get dressed       | 9       | 40      |        |        | 15    |     |
| Teams mtg         | 10      | 0       |        |        | 30    |  1  |
| exercises         | 10      | 30      |        |        | 10    |     |
| breakfast         | 10      | 40      |        |        | 30    |     |
| Check Hub         | 11      | 10      |        |        | 20    |     |
| ==email Alex==    | 11      | 30      |        |        | 15    |     |
| Plan tutorials    | 11      | 45      |        |        | 90    |     |
<!-- TBLFM: @I$2..@>$2=if($7==1, $2, if(@-1$4>0, @-1$4, if((@-1$3+@-1$6)<60, @-1, if((@-1$3+@-1$6)<120, (@-1+1), if((@-1$3+@-1$6)<180, (@-1+2), if((@-1$3+@-1$6)<240, (@-1+4), 999)))))) -->
<!-- TBLFM: @I$3..@>$3=if($7==1, $3, if(@-1$4>0, @-1$5, if((@-1$3+@-1$6)<60, (@-1$3+@-1$6), if((@-1$3+@-1$6)<120, ((@-1$3+@-1$6)-60), if((@-1$3+@-1$6)<180, ((@-1$3+@-1$6)-120), if((@-1$3+@-1$6)<240, ((@-1$3+@-1$6)-180), 999)))))) -->
<!-- TBLFM: @I$2..@>$2=if(@+1$7!=1, $2, if((($2*60)+($3+$6))>((@+1$2*60)+@+1$3), 8080808, $2)) -->

Having time calculations would:
1 Reduce the number of columns and make the table more readable
2 Replace two - possibly all three - hideous formulae with one less hideous formula, and not require repeat evaluations because the hours and minutes get out of sync
3 Allow one touch entry of "now" times instead of manually typing or Template... Hours... Next column... Template... Minutes

Generally, time calculations would make this a lot sleeker and more usable, and then I could share it with the people who are requesting this functionality from Day Planner. (If Day Planner could then be adapted to read a table instead of a list of tasks...
But that's another project)

@tgrosinger
Copy link
Owner

I think this is a duplicate of #31

@tgrosinger tgrosinger closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
@nolda
Copy link

nolda commented Oct 27, 2023

Emacs' Org mode actually supports operations on durations and times in table cells, with flags T and U.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants