Bug 163034 - Add Duration number format category
Summary: Add Duration number format category
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Date-and-Time
  Show dependency treegraph
 
Reported: 2024-09-18 21:34 UTC by Eyal Rozenberg
Modified: 2024-11-01 22:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Number format dialog with existing categories - no Duration (62.46 KB, image/png)
2024-09-18 21:34 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2024-09-18 21:34:25 UTC
Created attachment 196533 [details]
Number format dialog with existing categories - no Duration

Among our number format categories, we have "Time" and "Date"; but - what about durations? There are multiple ways to format durations, and basically none of them is offered. I'm not even sure if they're actually supported and the UI is missing, or whether they also need to be implemented. Without any formatting (i.e. general) - a difference between date fields, for example, seem to result in a fractional number of days. Not too bad, but not what the user often wants.

See also bug 67763 which mentions support for Durations internally.
Comment 2 Eyal Rozenberg 2024-09-18 22:56:49 UTC
(In reply to m_a_riosv from comment #1)
> https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html#:~:
> text=Of%20China%20Calendar-,Time%20Formats,Format%20Code,-Hours%20as%200

I skimmed the page... nothing seems to mention durations or elements-of-duration. So, were you telling me that there's no support for this number format as of yet?
Comment 3 m_a_riosv 2024-09-18 23:12:47 UTC
Time Formats
To display hours, minutes and seconds use the following number format codes:
Format	                            Format Code
Hours as 0-23	                         H
Hours as 00-23	                         HH
Hours as 00 up to more than 23	        [HH] <-----------
Minutes as 0-59	                         M
Minutes as 00-59	                 MM
Minutes as 00 up to more than 59	[MM] <-----------
Seconds as 0-59	                         S
Seconds as 00-59	                 SS
Seconds as 00 up to more than 59	[SS] <-----------

https://ask.libreoffice.org/t/time-as-duration/29472
Comment 4 Eyal Rozenberg 2024-09-18 23:48:40 UTC
(In reply to m_a_riosv from comment #3)
> Time Formats
> To display hours, minutes and seconds use the following number format codes:
> Format	                            Format Code
> Hours as 0-23	                         H
> Hours as 00-23	                         HH
> Hours as 00 up to more than 23	        [HH] <-----------
> Minutes as 0-59	                         M
> Minutes as 00-59	                 MM
> Minutes as 00 up to more than 59	[MM] <-----------
> Seconds as 0-59	                         S
> Seconds as 00-59	                 SS
> Seconds as 00 up to more than 59	[SS] <-----------
> 
> https://ask.libreoffice.org/t/time-as-duration/29472

Indeed, those _could_ be elements-of-duration. But how they interact is not explained; nor do we have days, months and years. So, this is not sufficient to render durations.
Comment 5 m_a_riosv 2024-09-19 00:04:59 UTC
Days are directly the value without decimals, so nothing is needed.

https://help.libreoffice.org/latest/en-US/text/scalc/01/04060102.html

And also, there are functions to calculate:
DATEDIF https://help.libreoffice.org/latest/en-US/text/scalc/01/func_datedif.html?&DbPAR=SHARED&System=WIN
YEARS
YEARFRAC
MONTHS
DAYS

If you want to deepen your knowledge of LibreOffice, please start by reading the manuals.