Skip to content

v2.0.7

Latest
Compare
Choose a tag to compare
@p333ter p333ter released this 17 Dec 14:23
· 1 commit to main since this release

Major enhancements to date handling and documentation:

  • Added support for string dates in ISO format (YYYY-MM-DD)
  • Fixed month calculation issues with JavaScript Date
  • Added clear documentation about date handling differences
  • Improved examples with detailed month handling explanations

Release Description

🎉 New Features

  • Added support for string dates in birth number generation (e.g., '1985-11-19')
  • Enhanced documentation with clear examples of date handling

🔨 Fixed

  • Corrected month calculation when using JavaScript Date objects
  • Fixed inconsistencies between string and Date object inputs

📚 Documentation

  • Added detailed explanation of date handling differences between string and Date formats
  • Updated examples to show recommended date input methods
  • Added warning notes about JavaScript Date's 0-based months

🔍 Technical Details

The birth number generator now:

  • Accepts both Date objects and ISO format strings
  • Properly handles month calculations regardless of input format
  • Maintains backwards compatibility with existing APIs
  • Uses dayjs for consistent date processing

💡 Usage Examples

// Recommended (string format)
generateBirthNumber({ 
 birthDate: '1985-11-19'  // November 19, 1985
})

// Legacy (Date object)
generateBirthNumber({ 
 birthDate: new Date(1985, 10, 19)  // Also November 19, 1985
})