Skip to content

Document the date add filters - #3329

Closed
NickJosevski wants to merge 1 commit into
mainfrom
nj/date-adds
Closed

Document the date add filters#3329
NickJosevski wants to merge 1 commit into
mainfrom
nj/date-adds

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Documents the full filter set from OctopusDeploy/Octostache#126. Third variant, alongside #3326 (AddHours/AddDays) and #3328 (AddTimeSpan).

Structure

  • Date add filters — one section covering AddSeconds, AddMinutes, AddHours, AddDays, AddWeeks, with a worked example per unit including negatives, fractionals (AddHours "1.5", AddDays "2.5" = 60 hours) and the Format chain.
  • AddMonths — its own section, because it shifts by calendar month rather than a fixed duration. Covers whole-months-only and day clamping (2030-01-31 + 1 month = 2030-02-28, leap year, and backwards), with an info callout linking to DateTime.AddMonths.
  • AddTimeSpan — its own section, with the format stated as {days}.{hours}:{minutes}:{seconds} in a code block and linked to the .NET TimeSpan.Parse remarks.

The warning callout

AddTimeSpan 48:00:00 is 48 days, not 48 hours — with the table showing the 23:00:0024:00:00 flip and the fact that 24:01:02 reads 02 as minutes rather than seconds. It closes by pointing at AddHours 48 as the unambiguous alternative, which this variant has and #3328 didn't.

A second callout covers quoting: the day form contains a ., which isn't valid in an unquoted filter argument.

Verification

Every value in every table was produced by running the expression through the implementation, not written by hand.

Second commit

Fixes pre-existing markdownlint violations in variable-filters.md — misaligned table pipes, asterisk lists, hard tabs. These already fail on main; CI lints only changed files, so touching the page surfaces them. Padding only, no content change.

Do not merge before OctopusDeploy/Octostache#126 ships.

🤖 Generated with Claude Code

Covers AddSeconds, AddMinutes, AddHours, AddDays, AddWeeks, AddMonths and
AddTimeSpan.

AddMonths gets its own section because it shifts by calendar month and
clamps the day to the end of a shorter month. AddTimeSpan gets one because
its {days}.{hours}:{minutes}:{seconds} format reads the leading field as
days above 23, so 48:00:00 is 48 days rather than 48 hours.

Also fixes pre-existing markdownlint violations in this file, which CI
surfaces because it lints only changed files. Table content is unchanged,
only cell padding and separator widths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@team-marketing-branch-protections

Copy link
Copy Markdown

Pull request environment is available at https://stoctodocspr3329.z22.web.core.windows.net.

You can view the ephemeral environment status in Octopus Deploy.

This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity.

@NickJosevski

Copy link
Copy Markdown
Contributor Author

Closing — going with the AddHours/AddDays shape in OctopusDeploy/Octostache#124 instead. The matching PR for that variant stays open.

@NickJosevski
NickJosevski deleted the nj/date-adds branch August 10, 2026 10:53
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