Skip to content

Commit db00a6e

Browse files
docs(v2.0.0): update readme
1 parent e80a1d6 commit db00a6e

File tree

1 file changed

+153
-31
lines changed

1 file changed

+153
-31
lines changed

README.md

Lines changed: 153 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,151 @@ const colombianHolidays2015 = colombianHolidays(2015);
4141

4242
The content of the `colombianHolidays2015` variable will be the following array:
4343

44-
<!-- prettier-ignore-start -->
4544
```js
4645
[
47-
{ date: '2015-01-01', celebrationDate: '2015-01-01', name: 'Año Nuevo', nextMonday: false },
48-
{ date: '2015-01-06', celebrationDate: '2015-01-12', name: 'Reyes Magos', nextMonday: true },
49-
{ date: '2015-03-19', celebrationDate: '2015-03-23', name: 'San José', nextMonday: true },
50-
{ date: '2015-04-02', celebrationDate: '2015-04-02', name: 'Jueves Santo', nextMonday: false },
51-
{ date: '2015-04-03', celebrationDate: '2015-04-03', name: 'Viernes Santo', nextMonday: false },
52-
{ date: '2015-05-01', celebrationDate: '2015-05-01', name: 'Día del Trabajo', nextMonday: false },
53-
{ date: '2015-05-14', celebrationDate: '2015-05-18', name: 'Ascensión del Señor', nextMonday: true },
54-
{ date: '2015-06-04', celebrationDate: '2015-06-08', name: 'Corpus Christi', nextMonday: true },
55-
{ date: '2015-06-12', celebrationDate: '2015-06-15', name: 'Sagrado Corazón de Jesús', nextMonday: true },
56-
{ date: '2015-06-29', celebrationDate: '2015-06-29', name: 'San Pedro y San Pablo', nextMonday: true },
57-
{ date: '2015-07-20', celebrationDate: '2015-07-20', name: 'Grito de la Independencia', nextMonday: false },
58-
{ date: '2015-08-07', celebrationDate: '2015-08-07', name: 'Batalla de Boyacá', nextMonday: false },
59-
{ date: '2015-08-15', celebrationDate: '2015-08-17', name: 'Asunción de la Virgen', nextMonday: true },
60-
{ date: '2015-10-12', celebrationDate: '2015-10-12', name: 'Día de la Raza', nextMonday: true },
61-
{ date: '2015-11-01', celebrationDate: '2015-11-02', name: 'Todos los Santos', nextMonday: true },
62-
{ date: '2015-11-11', celebrationDate: '2015-11-16', name: 'Independencia de Cartagena', nextMonday: true },
63-
{ date: '2015-12-08', celebrationDate: '2015-12-08', name: 'Inmaculada Concepción', nextMonday: false },
64-
{ date: '2015-12-25', celebrationDate: '2015-12-25', name: 'Navidad', nextMonday: false },
65-
]
46+
{
47+
date: "2015-01-01",
48+
celebrationDate: "2015-01-01",
49+
name: {
50+
es: "Año Nuevo",
51+
en: "New Year's day",
52+
},
53+
nextMonday: false,
54+
},
55+
{
56+
date: "2015-01-06",
57+
celebrationDate: "2015-01-12",
58+
name: {
59+
es: "Reyes Magos",
60+
en: "Epiphany",
61+
},
62+
nextMonday: true,
63+
},
64+
{
65+
date: "2015-03-19",
66+
celebrationDate: "2015-03-23",
67+
name: {
68+
es: "San José",
69+
en: "Saint Joseph's Day",
70+
},
71+
nextMonday: true,
72+
},
73+
{
74+
date: "2015-04-02",
75+
celebrationDate: "2015-04-02",
76+
{ es: "Jueves Santo", en: "Maundy Thursday" },
77+
nextMonday: false,
78+
},
79+
{
80+
date: "2015-04-03",
81+
celebrationDate: "2015-04-03",
82+
{ es: "Viernes Santo", en: "Good Friday" },
83+
nextMonday: false,
84+
},
85+
{
86+
date: "2015-05-01",
87+
celebrationDate: "2015-05-01",
88+
name: {
89+
es: "Día del Trabajo",
90+
en: "Labour Day",
91+
}
92+
nextMonday: false,
93+
},
94+
{
95+
date: "2015-05-14",
96+
celebrationDate: "2015-05-18",
97+
name: { es: "Ascensión del Señor", en: "Ascension of Jesus" },
98+
nextMonday: true,
99+
},
100+
{
101+
date: "2015-06-04",
102+
celebrationDate: "2015-06-08",
103+
name: { es: "Corpus Christi", en: "Corpus Christi" },
104+
nextMonday: true,
105+
},
106+
{
107+
date: "2015-06-12",
108+
celebrationDate: "2015-06-15",
109+
name: { es: "Sagrado Corazón de Jesús", en: "Sacred Heart" },
110+
nextMonday: true,
111+
},
112+
{
113+
date: "2015-06-29",
114+
celebrationDate: "2015-06-29",
115+
name: {
116+
es: "San Pedro y San Pablo",
117+
en: "Saint Peter and Saint Paul",
118+
},
119+
nextMonday: true,
120+
},
121+
{
122+
date: "2015-07-20",
123+
celebrationDate: "2015-07-20",
124+
name: {
125+
es: "Grito de la Independencia",
126+
en: "Declaration of Independence",
127+
},
128+
nextMonday: false,
129+
},
130+
{
131+
date: "2015-08-07",
132+
celebrationDate: "2015-08-07",
133+
name: {
134+
es: "Batalla de Boyacá",
135+
en: "Battle of Boyacá",
136+
},
137+
nextMonday: false,
138+
},
139+
{
140+
date: "2015-08-15",
141+
celebrationDate: "2015-08-17",
142+
name: {
143+
es: "Asunción de la Virgen",
144+
en: "Assumption of Mary",
145+
},
146+
nextMonday: true,
147+
},
148+
{
149+
date: "2015-10-12",
150+
celebrationDate: "2015-10-12",
151+
name: {
152+
es: "Día de la Raza",
153+
en: "Columbus Day",
154+
},
155+
nextMonday: true,
156+
},
157+
{
158+
date: "2015-11-01",
159+
celebrationDate: "2015-11-02",
160+
name: {
161+
es: "Todos los Santos",
162+
en: "All Saints’ Day",
163+
},
164+
nextMonday: true,
165+
},
166+
{
167+
date: "2015-11-11",
168+
celebrationDate: "2015-11-16",
169+
name: { es: "Independencia de Cartagena", en: "Independence of Cartagena" },
170+
nextMonday: true,
171+
},
172+
{
173+
date: "2015-12-08",
174+
celebrationDate: "2015-12-08",
175+
name: { es: "Inmaculada Concepción", en: "Immaculate Conception" },
176+
nextMonday: false,
177+
},
178+
{
179+
date: "2015-12-25",
180+
celebrationDate: "2015-12-25",
181+
name: { es: "Navidad", en: "Christmas" },
182+
nextMonday: false,
183+
},
184+
];
66185
```
67-
<!-- prettier-ignore-end -->
68186

69187
You can opt-in to have the function return native JavaScript dates instead of strings for the `date` and `celebrationDate` properties by using the `returnNativeDate` option:
70188

71-
<!-- prettier-ignore-start -->
72-
73189
```js
74190
const colombianHolidays2015 = colombianHolidays(2015, { returnNativeDate });
75191
```
@@ -89,14 +205,14 @@ The package provides two helper functions which can be imported from `lib/utils`
89205
Returns true if the given date is a colombian holiday, otherwise returns false.
90206

91207
```js
92-
import { isHoliday } from 'colombian-holidays/lib/utils/isHoliday'
208+
import { isHoliday } from "colombian-holidays/lib/utils/isHoliday";
93209

94-
const date = new Date("2018-01-01T05:00:00.000Z")
210+
const date = new Date("2018-01-01T05:00:00.000Z");
95211

96212
if (isHoliday(date)) {
97-
console.log('it is a colombian holiday');
213+
console.log("it is a colombian holiday");
98214
} else {
99-
console.log('it is NOT a colombian holiday');
215+
console.log("it is NOT a colombian holiday");
100216
}
101217
```
102218

@@ -105,7 +221,7 @@ if (isHoliday(date)) {
105221
Returns an with the colombian holidays within two dates:
106222

107223
```js
108-
import { holidaysWithinInterval } from 'colombian-holidays/lib/utils/holidaysWithinInterval'
224+
import { holidaysWithinInterval } from "colombian-holidays/lib/utils/holidaysWithinInterval";
109225

110226
const start = new Date("2021-01-01");
111227
const end = new Date("2021-01-11");
@@ -119,16 +235,22 @@ returns:
119235
{
120236
celebrationDate: "2021-01-01",
121237
date: "2021-01-01",
122-
name: "Año Nuevo",
238+
name: {
239+
es: "Año Nuevo",
240+
en: "New Year's day",
241+
},
123242
nextMonday: false,
124243
},
125244
{
126245
celebrationDate: "2021-01-11",
127246
date: "2021-01-06",
128-
name: "Reyes Magos",
247+
name: {
248+
es: "Reyes Magos",
249+
en: "Epiphany",
250+
},
129251
nextMonday: true,
130252
},
131-
]
253+
];
132254
```
133255

134256
### TypeScript

0 commit comments

Comments
 (0)