@@ -43,14 +43,16 @@ El objeto `Dayjs` es inmutable, por lo que toda operación de la API que altere
43
43
- [ Como objeto ` .toObject() ` ] ( #como-objecto-toobject )
44
44
- [ Como cadena ` .toString() ` ] ( #como-cadena-tostring )
45
45
- [ Consulta] ( #consulta )
46
- - [ Anterior a ` .isBefore(compared: Dayjs) ` ] ( #anterior-a-isbeforecompared-dayjs )
47
- - [ Igual que ` .isSame(compared: Dayjs) ` ] ( #igual-que-issamecompared-dayjs )
48
- - [ Posterior a ` .isAfter(compared: Dayjs) ` ] ( #posterior-a-isaftercompared-dayjs )
46
+ - [ Anterior a ` .isBefore(compared: Dayjs, unit?: string ) ` ] ( #anterior-a-isbeforecompared-dayjs-unit-string )
47
+ - [ Igual que ` .isSame(compared: Dayjs, unit?: string ) ` ] ( #igual-que-issamecompared-dayjs-unit-string )
48
+ - [ Posterior a ` .isAfter(compared: Dayjs, unit?: string ) ` ] ( #posterior-a-isaftercompared-dayjs-unit-string )
49
49
- [ Es Dayjs ` .isDayjs() ` ] ( #es-dayjs-isdayjscompared-any )
50
50
- [ API de complementos] ( #api-de-complementos )
51
51
- [ RelativeTime] ( #relativetime )
52
52
- [ IsLeapYear] ( #isleapyear )
53
53
- [ WeekOfYear] ( #weekofyear )
54
+ - [ IsSameOrAfter] ( #issameorafter )
55
+ - [ IsSameOrBefore] ( #issameorbefore )
54
56
- [ IsBetween] ( #isbetween )
55
57
56
58
## Análisis
@@ -383,28 +385,31 @@ dayjs('2019-01-25').toString(); // 'Fri, 25 Jan 2019 02:00:00 GMT'
383
385
384
386
## Consulta
385
387
386
- ### Anterior a ` .isBefore(compared: Dayjs) `
388
+ ### Anterior a ` .isBefore(compared: Dayjs, unit?: string ) `
387
389
388
390
Devuelve un dato de tipo ` boolean ` , que indica si la fecha del objeto ` Dayjs ` inicial es anterior o no a la fecha del objeto ` Dayjs ` a comparar.
389
391
390
392
``` js
391
393
dayjs ().isBefore (dayjs ()); // false
394
+ dayjs ().isBefore (dayjs (), ' year' ); // false
392
395
```
393
396
394
- ### Igual que ` .isSame(compared: Dayjs) `
397
+ ### Igual que ` .isSame(compared: Dayjs, unit?: string ) `
395
398
396
399
Devuelve un dato de tipo ` boolean ` , que indica si la fecha del objeto ` Dayjs ` inicial es igual o no que la fecha del objeto ` Dayjs ` a comparar.
397
400
398
401
``` js
399
402
dayjs ().isSame (dayjs ()); // true
403
+ dayjs ().isSame (dayjs (), ' year' ); // true
400
404
```
401
405
402
- ### Posterior a ` .isAfter(compared: Dayjs) `
406
+ ### Posterior a ` .isAfter(compared: Dayjs, unit?: string ) `
403
407
404
408
Devuelve un dato de tipo ` boolean ` , que indica si la fecha del objeto ` Dayjs ` inicial es posterior o no a la fecha del objeto ` Dayjs ` a comparar.
405
409
406
410
``` js
407
411
dayjs ().isAfter (dayjs ()); // false
412
+ dayjs ().isAfter (dayjs (), ' year' ); // false
408
413
```
409
414
410
415
### Es Dayjs ` .isDayjs(compared: any) `
@@ -436,6 +441,18 @@ complemento [`IsLeapYear`](./Plugin.md#isleapyear)
436
441
437
442
complemento [ ` WeekOfYear ` ] ( ./Plugin.md#weekofyear )
438
443
444
+ ### IsSameOrAfter
445
+
446
+ ` .isSameOrAfter ` to check if a date is same of after another date
447
+
448
+ plugin [ ` IsSameOrAfter ` ] ( ./Plugin.md#issameorafter )
449
+
450
+ ### IsSameOrBefore
451
+
452
+ ` .isSameOrBefore ` to check if a date is same of before another date.
453
+
454
+ plugin [ ` IsSameOrBefore ` ] ( ./Plugin.md#issameorbefore )
455
+
439
456
### IsBetween
440
457
441
458
` .isBetween ` para comprobar si una fecha se encuentra entre otras dos fechas dadas
0 commit comments