{"repo":"gastromatic/calendar-date","free":true,"listed":false,"github":"https://github.com/gastromatic/calendar-date","clone":"git clone https://github.com/gastromatic/calendar-date.git","description":"Immutable object to represent and work with a calendar date with zero dependencies","language":"TypeScript","stars":23,"topics":["typescript","javascript","date","calendar","calendar-date","day"],"license":"MIT","category":"productivity","readme_excerpt":"calendar-date A calendar date is a date without time information, e.g. \"2020-01-01\". This library provides an immutable object to represent and work with a calendar date. Why another date library? There are a lot of date libraries in the javascript world, but there is currently no adequate support for representing a calendar date. Most SQL Databases like MySQL and PostgreSQL have a datatype for representing a date without time information. Using the built-in date object for a calendar date poses a number of disadvantages: - If you are using typescript you can not tell if the object is representing a timestamp, or a calendar date by looking at the type definition. - If you want to compare two date objects it is harder to do it without knowing if the time and timezone information are the same. - Overhead by including time and timezone information in the representation. - Error prone when working with different timezones and converting from and to Strings. For example new Date(2020, 0, 1) and new Date('2020-01-01') return different Date objects depending on your local timezone. If you call toISOString() on both date objects based on a timezone of UTC+1 it would return 2019-12-31T23:00:00.000Z for the first and 2020-01-01T00:00:00.000Z for the second. Features - CalendarDate and CalendarDateRange - Immutable API - Written completely in typescript - No external dependencies - Tiny package size Getting Started Install with bun, npm or yarn: or or Documentation CalendarDate You can ","default_branch":null,"files":null,"tree":[],"storefront":"/r/gastromatic","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/gastromatic/calendar-date/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}