Skip to content

Releases: maniartech/gotime

GoTime v2.0.3 — Docs/import hotpatch (supersedes v2.0.2)

26 Dec 07:33

Choose a tag to compare

Summary

Docs-only hotpatch to finish the v2 module path migration. No API or behavior changes. Supersedes v2.0.2.

What’s fixed

  • Normalized all internal imports to github.com/maniartech/gotime/v2 (nites/cache/utils already in code; this finalizes docs/examples).
  • Updated all docs and examples to use the v2 module path and current install command.
  • Confirmed full test suite passes.

Upgrade

go get github.com/maniartech/gotime/v2@v2.0.3

GoTime v2,0.1 - Complete Architectural Overhaul

10 Jul 12:41

Choose a tag to compare

GoTime Release Notes

Version 2.0.0 (v2.0.0) - July 10, 2025

🎉 Major Release: Complete Architectural Modernization

Tag: v2.0.0
Previous Version: v1.1.0
Release Date: July 10, 2025

🚀 Major Changes

Complete Architectural Overhaul

Version 2.0.0 represents a comprehensive architectural modernization that addresses critical Go design principles while significantly expanding functionality. This release includes both foundational improvements and major feature additions.

1. Go Standards Architectural Enhancement

Comprehensive modernization to align with Go design principles - Addressed fundamental violations of Go best practices:

Eliminated Panic Anti-Patterns:

// v1.x - WRONG: Panics for user input
func Years(years int, dt ...time.Time) time.Time {
    if years == 0 {
        panic("Years parameter can't be zero") // ❌
    }
}

// v2.0 - CORRECT: Zero is valid no-op
func Years(years int, dt ...time.Time) time.Time {
    return t.AddDate(years, 0, 0) // ✅ Any int valid
}

Go-Idiomatic Error Handling:

  • Removed all panic() calls for user input validation
  • Zero values now treated as valid no-ops (following Go time package conventions)
  • Negative values correctly go to past dates

Consistent Naming Conventions:

  • SoDDayStart (with backward-compatible aliases)
  • EoDDayEnd (with backward-compatible aliases)
  • Clear, Go-standard naming throughout API

2. IDFS → NITES Rebranding

Strategic rebranding from IDFS (Intuitive Date Format Specifiers) to NITES (Natural and Intuitive Time Expression Syntax) for better developer communication.

What Changed:

  • Package Restructuring: internal/idfs/internal/nites/
  • Documentation Updates: All references now use NITES terminology
  • Enhanced Branding: Clearer mission statement and improved developer experience
  • Better Positioning: NITES more accurately reflects the library's core value proposition

3. Major Feature Additions

Complete Time Arithmetic Family:

// NEW: Time-level arithmetic (completing the API)
func Hours(hours int, dt ...time.Time) time.Time
func Minutes(minutes int, dt ...time.Time) time.Time
func Seconds(seconds int, dt ...time.Time) time.Time

Complete Quarter Operations:

// NEW: Full quarter navigation suite
func QuarterStart(dt ...time.Time) time.Time
func QuarterEnd(dt ...time.Time) time.Time
func LastQuarter() time.Time
func NextQuarter() time.Time
func Quarters(quarters int, dt ...time.Time) time.Time

Enhanced Business Calendar:

// NEW: Simplified business day utilities
func IsBusinessDay(t time.Time, weekends, holidays) bool
func NextBusinessDay(t time.Time, weekends, holidays) time.Time
func PrevBusinessDay(t time.Time, weekends, holidays) time.Time

Calendar Math Utilities:

// NEW: Common calendar calculations
func DayOfYear(t time.Time) int
func WeekOfMonth(t time.Time) int
func IsFirstDayOfMonth(t time.Time) bool
func IsLastDayOfMonth(t time.Time) bool

4. Comprehensive Documentation System

NEW: Complete documentation ecosystem - Added extensive documentation structure:

Documentation Architecture:

docs/
├── api-reference/          # Complete API documentation
│   ├── calendar-math.md    # Calendar calculation functions
│   ├── conversion.md       # Format conversion utilities
│   ├── date-ranges.md      # Date range operations
│   ├── parsing-formatting.md # Parse and format functions
│   ├── relative-time.md    # Relative time functions
│   ├── time-calculations.md # Time arithmetic
│   └── utilities.md        # Utility functions
├── core-concepts/          # Fundamental concepts
│   ├── nites.md           # NITES format specification
│   └── why-gotime.md      # Library philosophy
├── getting-started/        # User onboarding
│   ├── installation.md    # Installation guide
│   ├── quick-start.md     # Quick start tutorial
│   └── basic-usage.md     # Basic usage patterns
├── examples/              # Real-world examples
└── STYLE_GUIDE.md        # Coding standards

Documentation Features:

  • Complete API Reference: Every function documented with examples
  • Getting Started Guide: Comprehensive onboarding for new users
  • Core Concepts: Deep dive into NITES and library philosophy
  • Real-world Examples: Practical use cases and patterns
  • Style Guide: Contribution standards and best practices

Godoc Documentation Standardization:

  • Fixed Critical Documentation Issues: Standardized all function documentation to follow strict Go standards
  • Consistent Documentation Style: Eliminated inconsistent patterns across 15+ source files
  • Professional Godoc Comments: Every public function now has proper Godoc with examples
  • Removed Non-Standard Patterns: Eliminated "# Arguments" sections and verbose descriptions
  • Go-Compliant Examples: All examples follow Go documentation conventions with realistic outputs

5. Algorithm Quality Improvements

  • Fixed Hard-coded Special Cases: Removed magic numbers and date-specific logic
  • Robust Calculations: All functions now use consistent, mathematically sound algorithms
  • Performance Optimizations: Enhanced caching and memory efficiency

What Stayed the Same:

  • Zero Breaking Changes - All existing public APIs remain identical
  • 100% Test Coverage - All 260+ test cases preserved and expanded
  • Performance - Enhanced performance with better algorithms
  • Backward Compatibility - Deprecated functions preserved with aliases

📦 Core Features & Improvements

Architectural Excellence Achieved

Go Standards Compliance: All critical architectural issues identified in the comprehensive review have been resolved:

  • ✅ API Design Score: A+ - Consistent error handling, no panics for user input
  • ✅ Code Quality Score: A+ - No hard-coded special cases, robust algorithms
  • ✅ Naming Conventions: A+ - Clear, Go-idiomatic names throughout

Complete API Coverage

Expanded from 60% to 95%+ industry coverage:

Time Arithmetic Family (NEW):

  • Hours(), Minutes(), Seconds() - Complete time-level arithmetic
  • Consistent signatures matching existing Years(), Months(), Days()

Quarter Operations (NEW - COMPLETE):

  • QuarterStart(), QuarterEnd() - Quarter boundary navigation
  • LastQuarter(), NextQuarter() - Quarter navigation
  • Quarters(n) - Add/subtract quarters with same pattern as other functions

Calendar Math Suite (NEW):

  • DayOfYear(), WeekOfMonth() - Essential calendar calculations
  • IsFirstDayOfMonth(), IsLastDayOfMonth() - Month boundary helpers
  • QuarterOfYear() - Quarter identification

Enhanced Business Calendar:

  • Simplified business day functions with consistent interfaces
  • Configurable weekend and holiday support
  • Performance-optimized for high-frequency usage

Enhanced Documentation System

  • NEW: Complete Documentation Ecosystem: Comprehensive docs/ structure with API reference, getting started guides, core concepts, and examples
  • NITES Documentation: Complete NITES specification with formal grammar in docs/core-concepts/nites.md
  • Comprehensive API Reference: Every function documented in docs/api-reference/ with practical examples
  • Getting Started System: Complete onboarding in docs/getting-started/ (installation, quick-start, basic usage)
  • Real-world Examples: Practical use cases and patterns in docs/examples/
  • Go-Standard Godoc Compliance: Complete standardization of all function documentation following strict Go conventions
  • Consistent Documentation Style: Fixed inconsistent patterns across 15+ source files, eliminating non-standard formats
  • Professional Godoc Comments: Every public function now has proper Godoc with realistic examples and consistent formatting

Robust Testing Infrastructure

  • 260+ Test Executions: Comprehensive test coverage across all packages
    • Main package: 225 test executions
    • Internal cache package: 2 test executions
    • Internal NITES package: 11 test executions
  • 100% Test Coverage: Every function thoroughly tested
  • Advanced Test Scripts: Enhanced testing tools in scripts/

Performance & Reliability

  • Caching System: Optimized format conversion caching
  • Memory Efficiency: Reduced allocation patterns
  • Runtime Compatibility: Support for Go 1.19+ with version-specific optimizations
  • TinyGo Support: Full compatibility with embedded and WebAssembly environments

🔧 Technical Improvements

Critical Architectural Fixes

Go Standards Compliance:

  • No More Panics: Removed all panic() calls for user input validation
  • Consistent Error Handling: All functions follow Go standard library patterns
  • Mathematical Correctness: Zero is now a valid no-op, negative values go to past

Algorithm Quality Overhaul:

  • Removed Hard-coded Special Cases: No more magic numbers or date-specific logic
  • Robust Calculations: All functions use consistent, mathematically sound algorithms
  • Edge Case Handling: Proper boundary condition handling throughout

Code Quality Enhancements

  • Go-Idiomatic Naming: Clear, consistent names following Go conventions (SoDDayStart)
  • Function Signature Consistency: Uniform patterns across all time arithmetic functions
  • Complete API Families: No more missing function pairs or incomplete implementations
  • Documentation Standards: Every function documented with Godoc examples following strict Go standards
  • Godoc Standardization: Fixed inconsistent documentation patterns across all source files
  • **...
Read more

1.0.0

30 Jan 07:56

Choose a tag to compare

GoTime Library Release Notes - Version 1.0.0

We are thrilled to announce the release of GoTime 1.0.0, a significant milestone in providing a user-friendly date and time processing library for Go developers. This release marks the culmination of rigorous development and testing, ensuring a robust and feature-rich library that enhances the standard Go time package.

New Features

  • Human-Friendly Date Parsing and Formatting: Easily parse and format dates in formats like dd/mm/yyyy, enhancing readability and ease of use.
  • Relative Time Processing: Convert datetime objects into relative time descriptions such as 'a few minutes ago', 'yesterday', or '3 years from now'.
  • Date Conversion Utility: Convert dates between different formats, for example from dd/mm/yyyy to yyyy-mm-dd.
  • Date Range Functions: Implement functions like Yesterday(), Tomorrow(), Start of Day (SoD), and End of Day (EoD) for easy date range handling.
  • Utility Functions: Access a suite of new functions including Latest(), Earliest(), IsBetween(), and TruncateDate(), filling gaps in the standard time package.

Improvements

  • Enhanced Performance: Optimized algorithms for faster processing of date and time operations.
  • Increased Compatibility: Ensured compatibility with the latest Go version.
  • Improved Documentation: Comprehensive and user-friendly documentation, including examples and use cases.

Bug Fixes

  • Fixed various minor bugs identified during the beta testing phase.
  • Improved error handling and edge case management for date parsing.

Acknowledgements

We want to extend our heartfelt thanks to our community of developers and contributors who have provided invaluable feedback and suggestions, helping shape this libraryinto a powerful tool for Go development.

Getting Started

To start using GoTime, visit our GitHub repository at https://github.com/maniartech/gotime/. Detailed installation and usage instructions are provided to help you integrate it seamlessly into your projects.

Thank you for your support, and we look forward to your feedback and contributions to make GoTime even better!