Skip to content

Dedicated column for target time prefix#95

Open
PrinterElf wants to merge 3 commits intolozzd:mainfrom
PrinterElf:patch-1
Open

Dedicated column for target time prefix#95
PrinterElf wants to merge 3 commits intolozzd:mainfrom
PrinterElf:patch-1

Conversation

@PrinterElf
Copy link

Add a new column to the left of the timestamp to hold the prefix for any target time entries. Ensures that the times still remain aligned when there's a target time.

Add a new column to the left of the timestamp to hold the prefix for any target time entries.
Ensures that the times still remain aligned when there's a target time.

if (showpast || (date - Date.parse(new Date()) > -1800000)) {
table = table.concat("<tr class='rate_row'><td class='time " + boldStyle + " " + "time_" + colour + targetTimeBackgroundColor + "'>" + targetTimePrefix + date_locale + time_locale +
table = table.concat("<tr class='rate_row'><td class='target " + "time_" + colour + targetTimeBackgroundColor + "'>" + targetTimePrefix + "<td class='time " + boldStyle + " " + "time_" + colour + targetTimeBackgroundColor + "'>" + date_locale + time_locale +
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is getting a bit unwieldy - you commented out the section that forms this string targetTimePrefix above, does that still work proprely? can it be re-used to make this a bit shorter? Thanks!

Copy link
Author

@PrinterElf PrinterElf Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, totally missed the notification for this.
I suppose it could be; build the three cells separately (prefix, time, and rate) then just concatenate the variables.
Plus I've just realised I didn't close off the cell I added, so there's a missing "</td>" just before the second "<td class="

Updated the table row printing line to use individual variables for each column.
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

Successfully merging this pull request may close these issues.

2 participants