soff-date 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +67 -46
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,80 +1,101 @@
1
- # Soff Date
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/bledxs/soff-monorepo/master/assets/logo.png" alt="Soff Logo" width="100" height="100">
3
+ <h1>Soff Date</h1>
4
+ <p>Lightweight, tree-shakeable holiday calculator with algorithmic date computation.</p>
5
+ </div>
6
+
7
+ <div align="center">
2
8
 
3
9
  [![npm](https://img.shields.io/npm/v/soff-date)](https://www.npmjs.com/package/soff-date)
4
- [![License](https://img.shields.io/github/license/bledxs/soff-date)](LICENSE)
5
- [![Build Status](https://github.com/bledxs/soff-date/actions/workflows/ci.yml/badge.svg)](https://github.com/bledxs/soff-date/actions)
6
- [![codecov](https://codecov.io/gh/bledxs/soff-date/branch/main/graph/badge.svg)](https://codecov.io/gh/bledxs/soff-date)
10
+ [![License](https://img.shields.io/github/license/bledxs/soff-monorepo)](LICENSE)
11
+ [![Build Status](https://github.com/bledxs/soff-monorepo/actions/workflows/ci.yml/badge.svg)](https://github.com/bledxs/soff-monorepo/actions)
12
+ [![codecov](https://codecov.io/gh/bledxs/soff-monorepo/branch/master/graph/badge.svg)](https://codecov.io/gh/bledxs/soff-monorepo)
7
13
  [![minzipped size](https://img.shields.io/bundlephobia/minzip/soff-date)](https://bundlephobia.com/package/soff-date)
8
- [![All Contributors](https://img.shields.io/github/all-contributors/bledxs/soff-date?color=ee8449&style=flat-square)](#contributors)
14
+ [![All Contributors](https://img.shields.io/github/all-contributors/bledxs/soff-monorepo?color=ee8449&style=flat-square)](#contributors)
15
+
16
+ </div>
9
17
 
10
- Lightweight, tree-shakeable holiday calculator with algorithmic date computation.
18
+ ---
11
19
 
12
20
  **Zero dependencies** · **TypeScript** · **~3KB per locale**
13
21
 
14
22
  ## Table of Contents
15
23
 
16
- - [Soff Date](#soff-date)
17
- - [Table of Contents](#table-of-contents)
18
- - [Why?](#why)
19
- - [Install](#install)
20
- - [Quick Start](#quick-start)
21
- - [i18n Support](#i18n-support)
22
- - [Available Locales](#available-locales)
23
- - [Available Languages](#available-languages)
24
- - [Shift Rules Explained](#shift-rules-explained)
25
- - [Emiliani (Colombia, Argentina)](#emiliani-colombia-argentina)
26
- - [Observed US (USA, UK)](#observed-us-usa-uk)
27
- - [Advanced: Create Your Own Locale](#advanced-create-your-own-locale)
28
- - [Advanced: Use Algorithms Directly](#advanced-use-algorithms-directly)
29
- - [Bundle Size](#bundle-size)
30
- - [API Reference](#api-reference)
31
- - [`getHolidays(year, options?)`](#getholidaysyear-options)
32
- - [`isHoliday(date, options?)`](#isholidaydate-options)
33
- - [`getNextHoliday(from?, options?)`](#getnextholidayfrom-options)
34
- - [Types](#types)
35
- - [Contributing](#contributing)
36
- - [License](#license)
37
- - [Documentation](#documentation)
38
- - [Contributors](#contributors)
39
-
40
- ## Why?
41
-
42
- Most holiday libraries ship giant JSON files with dates until 2050. This library **calculates dates algorithmically**, supporting:
43
-
44
- - Fixed dates (`December 25`)
45
- - Nth weekday (`3rd Monday of January`)
46
- - Easter-relative (`Good Friday = Easter - 2 days`)
47
- - Shift rules (`Emiliani`, `Observed US`)
48
-
49
- ## Install
24
+ - [Table of Contents](#table-of-contents)
25
+ - [🤔 Why?](#-why)
26
+ - [📦 Install](#-install)
27
+ - [🚀 Quick Start](#-quick-start)
28
+ - [🌍 i18n Support](#-i18n-support)
29
+ - [Available Locales](#available-locales)
30
+ - [Available Languages](#available-languages)
31
+ - [Shift Rules Explained](#shift-rules-explained)
32
+ - [Emiliani (Colombia, Argentina)](#emiliani-colombia-argentina)
33
+ - [Observed US (USA, UK)](#observed-us-usa-uk)
34
+ - [Advanced: Create Your Own Locale](#advanced-create-your-own-locale)
35
+ - [Advanced: Use Algorithms Directly](#advanced-use-algorithms-directly)
36
+ - [Bundle Size](#bundle-size)
37
+ - [API Reference](#api-reference)
38
+ - [`getHolidays(year, options?)`](#getholidaysyear-options)
39
+ - [`isHoliday(date, options?)`](#isholidaydate-options)
40
+ - [`getNextHoliday(from?, options?)`](#getnextholidayfrom-options)
41
+ - [Types](#types)
42
+ - [Contributing](#contributing)
43
+ - [License](#license)
44
+ - [Documentation](#documentation)
45
+ - [Contributors](#contributors)
46
+
47
+ ## 🤔 Why?
48
+
49
+ Most holiday libraries ship **giant JSON files** with dates until 2050. This library **calculates dates algorithmically**, supporting:
50
+
51
+ | Feature | Description | Example |
52
+ | ---------------------- | ----------------------------- | ------------------------------- |
53
+ | 📅 **Fixed Dates** | Static dates every year | December 25 (Christmas) |
54
+ | 📆 **Nth Weekday** | Relative weekday calculations | 3rd Monday of January (MLK Day) |
55
+ | ✨ **Easter-relative** | Based on Easter calculation | Good Friday = Easter - 2 days |
56
+ | 🔄 **Shift Rules** | Move holidays to workdays | Colombia's Emiliani Law |
57
+
58
+ **Result:** Tiny bundle size (~3KB) with unlimited year support! 🎉
59
+
60
+ ## 📦 Install
50
61
 
51
62
  ```bash
63
+ # npm
52
64
  npm install soff-date
65
+
66
+ # pnpm
67
+ pnpm add soff-date
68
+
69
+ # yarn
70
+ yarn add soff-date
71
+
72
+ # bun
73
+ bun add soff-date
53
74
  ```
54
75
 
55
- ## Quick Start
76
+ ## 🚀 Quick Start
56
77
 
57
78
  ```typescript
58
79
  // Only Colombia included in bundle (~3KB)
59
80
  import { getHolidays, isHoliday, getNextHoliday } from 'soff-date/locales/co';
60
81
 
61
- // Get all holidays for a year
82
+ // 🏆 Get all holidays for a year
62
83
  getHolidays(2025);
63
84
  // → [{ date: '2025-01-01', key: 'newYear', name: 'Año Nuevo' }, ...]
64
85
 
65
- // Check if a date is a holiday
86
+ // Check if a date is a holiday
66
87
  isHoliday(new Date('2025-01-01'));
67
88
  // → { date: '2025-01-01', key: 'newYear', name: 'Año Nuevo' }
68
89
 
69
90
  isHoliday(new Date('2025-01-02'));
70
91
  // → null
71
92
 
72
- // Get next holiday from a date
93
+ // ➡️ Get next holiday from a date
73
94
  getNextHoliday(new Date('2025-01-02'));
74
95
  // → { date: '2025-01-06', key: 'epiphany', name: 'Día de los Reyes Magos' }
75
96
  ```
76
97
 
77
- ## i18n Support
98
+ ## 🌍 i18n Support
78
99
 
79
100
  ```typescript
80
101
  import { getHolidays } from 'soff-date/locales/co';
@@ -268,7 +289,7 @@ Thanks goes to these wonderful people ([emoji key](https://all-contributors.js.o
268
289
  <table>
269
290
  <tbody>
270
291
  <tr>
271
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/bledxs"><img src="https://avatars.githubusercontent.com/u/90062924?v=4" width="100px;" alt="Luis C. Rojas"/><br /><sub><b>Luis C. Rojas</b></sub></a><br /><a href="https://github.com/bledxs/soff-date/commits?author=bledxs" title="Code">💻</a> <a href="https://github.com/bledxs/soff-date/commits?author=bledxs" title="Documentation">📖</a> <a href="#maintenance-bledxs" title="Maintenance">🚧</a></td>
292
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/bledxs"><img src="https://avatars.githubusercontent.com/u/90062924?v=4" width="100px;" alt="Luis C. Rojas"/><br /><sub><b>Luis C. Rojas</b></sub></a><br /><a href="https://github.com/bledxs/soff-monorepo/commits?author=bledxs" title="Code">💻</a> <a href="https://github.com/bledxs/soff-monorepo/commits?author=bledxs" title="Documentation">📖</a> <a href="#maintenance-bledxs" title="Maintenance">🚧</a></td>
272
293
  </tr>
273
294
  </tbody>
274
295
  </table>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soff-date",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Lightweight, tree-shakeable holiday calculator with algorithmic date computation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -162,7 +162,7 @@
162
162
  "bugs": {
163
163
  "url": "https://github.com/bledxs/soff-monorepo/issues"
164
164
  },
165
- "homepage": "https://github.com/bledxs/soff-monorepo/tree/main/packages/soff-date#readme",
165
+ "homepage": "https://github.com/bledxs/soff-monorepo/tree/master/packages/soff-date#readme",
166
166
  "engines": {
167
167
  "node": ">=20"
168
168
  },