tgrosinger / md-advanced-tables

A text editor independent library to enable formatting and Excel-style navigation, and spreadsheet formulas to Markdown tables.
MIT License
151 stars 30 forks source link

Overflow bug when using durations #93

Closed handarel closed 4 weeks ago

handarel commented 4 weeks ago

When formatting a number with ;hm and it results in a value above 99:59, it overflows. You can use the following tables to reproduce the bug:

| Start Date       | End Date         | Duration (Expected) | Duration (Actual) |
| ---------------- | ---------------- | -------------------:| -----------------:|
| 2024-11-01 08:00 | 2024-11-05 14:00 |              102:00 |             02:00 |
<!-- TBLFM: $>=($2-$1);hm -->
| Date                | Start Time | End Time | Duration (Expected) | Duration (Actual) |
| ------------------- | ----------:| --------:| -------------------:| -----------------:|
| 2024-11-01          |      01:00 |    23:00 |               22:00 |             22:00 |
| 2024-11-02          |      01:00 |    23:00 |               22:00 |             22:00 |
| 2024-11-03          |      01:00 |    23:00 |               22:00 |             22:00 |
| 2024-11-04          |      01:00 |    23:00 |               22:00 |             22:00 |
| 2024-11-05          |      01:00 |    23:00 |               22:00 |             22:00 |
| **Total Duration:** |            |          |              110:00 |             10:00 |
<!-- TBLFM: $>=($3-$2);hm -->
<!-- TBLFM: @>$>=sum(@2$>..@-1$>);hm -->

Obsidian Version: 1.7.4 Advanced Tables Version: 0.22.1

handarel commented 4 weeks ago

I noticed I posted this in the general repository, not the one for the Obsidian plugin.