Skip to content

Commit 972ccc3

Browse files
author
Bifuer
committed
Merge branch 'master' of https://github.com/bifuer/Date.format
2 parents 4546330 + ee51768 commit 972ccc3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Languages:[[EN](#),[ES](#dateformat-es)]
55

66
Add to [JS Date.prototype](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) `.format()` method, allow format the object date in a readable form.
77
Call to method with the pattern you want and will return it formated.
8+
9+
> Date.format is based on [String.format](https://github.com/bifuer/String.format) > "Hello {name}!".format({name:"Homer"});
10+
811
[npm](https://www.npmjs.com/package/date.format)
912

1013
```javascript
@@ -39,8 +42,12 @@ console.log(date.format("UTC: Day {YY}/{MM}/{DD} at {hh}:{mm}:{ss} and {mss}ms",
3942
+ **h**: hour without leading zeros 0-23. **hh** hour 2 digits.
4043
+ **m**: minutes without leading zeros 0-59. **mm** minutes 2 digits.
4144
+ **s**: seconds without leading zeros 0-59. **ss** seconds 2 digits.
42-
+ **ms**: milliseconds without leading zeros 0-999. **mss** milliseconds 4 digits.
45+
+ **ms**: milliseconds without leading zeros 0-999. **mss** milliseconds 4 digits.
46+
47+
NEW:
4348

49+
+ **tz**: Timezone difference between UTC and Local Time in minutes
50+
+ **tzh**: Timezone difference between UTC and Local Time in hours
4451

4552
## Licence
4653
MIT
@@ -51,6 +58,9 @@ MIT
5158

5259
Añade a [Date.prototype de JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) el método `.format()`, permitiendo formatear el objeto date de una forma legible.
5360
Especificamos al método el formato en el que devolverá el objeto date.
61+
62+
> Date.format utiliza [String.format](https://github.com/bifuer/String.format) > "Hello {name}!".format({name:"Homer"});
63+
5464
[npm](https://www.npmjs.com/package/date.format)
5565

5666
```javascript
@@ -86,6 +96,10 @@ console.log(date.format("UTC: Day {YY}/{MM}/{DD} at {hh}:{mm}:{ss} and {mss}ms",
8696
+ **s**: segundos sin ceros iniciales 0-59. **ss** segundos en 2 dígitos.
8797
+ **ms**: milisegundos sin ceros iniciales 0-999. **mss** milisegundos 4 dígitos.
8898
99+
NEW:
100+
101+
+ **tz**: Diferencia de la zona horaria con respecto a UTC en minutos
102+
+ **tzh**: Diferencia de la zona horaria con respecto a UTC en horas
89103
90104
## Licencia
91105
MIT

0 commit comments

Comments
 (0)