Skip to content

Add weekday helpers, fluent methods, and format constants#78

Open
dfang wants to merge 5 commits into
jinzhu:masterfrom
dfang:feat/add-helpers
Open

Add weekday helpers, fluent methods, and format constants#78
dfang wants to merge 5 commits into
jinzhu:masterfrom
dfang:feat/add-helpers

Conversation

@dfang

@dfang dfang commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

This PR introduces several improvements and documentation updates:

  • Add weekday helper functions (Tuesday-Saturday) and refactor weekday logic via weekdayHelper
  • Add fluent methods: Add, AddDays, AddWeeks, AddMonths, AddYears
  • Add format convenience methods and common date/time format constants
  • Add time checking and calculation helpers (IsYesterday/IsTomorrow/IsSameWeek, etc.)
  • Fix README ISO8601 example and expand docs for new features
  • Align formatter methods with shared layout constants

All tests pass: `go test ./...`
Notes:

  • MonthsUntil/MonthsSince are approximate (year*12 + month), by design.
  • Consider adding tests for WeeksUntil/WeeksSince and month boundary cases.

dfang and others added 5 commits August 25, 2025 00:41
Following the same pattern as Monday and Sunday functions, this commit adds the remaining weekday functions to provide a complete set of weekday date calculations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- IsToday(t time.Time): checks if a given time is within today
- IsTimestampToday(timestamp float64): checks Unix timestamp in seconds (10 digits)
- IsMillisecondTimestampToday(timestamp float64): checks Unix timestamp in milliseconds (13 digits)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed IsToday, IsTimestampToday, IsMillisecondTimestampToday, IsWeekend, and IsWeekday from methods to standalone functions for better usability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant