@endesyc/format 1.0.1 → 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.
package/README.md CHANGED
@@ -1,429 +1,429 @@
1
- # ENDESYC Format Library
2
-
3
- Librería Angular compartida para fechas y montos.
4
-
5
- ## Instalar
6
- ```bash
7
- npm install
8
- npm test
9
- npm run build
10
- npm run pack
11
- ```
12
-
13
- ## Paquete
14
- ```bash
15
- npm install @endesyc/format@1.0.0
16
- ```
17
-
18
- # ENDESYC Format
19
-
20
- Angular library for formatting dates, times and Bolivian currency.
21
-
22
- ---
23
-
24
- ## Características
25
-
26
- ✔ Formateo de fechas
27
-
28
- ✔ Formateo de horas
29
-
30
- ✔ Formateo de fechas y horas
31
-
32
- ✔ Formateo de moneda boliviana (BOB)
33
-
34
- ✔ Pipes para Angular
35
-
36
- ✔ Utilidades reutilizables
37
-
38
- ✔ Soporte para valores nulos
39
-
40
- ✔ Formatos centralizados mediante DateFormats
41
-
42
- ---
43
-
44
- # Instalación
45
-
46
- ```bash
47
- npm install @endesyc/format
48
- ```
49
-
50
- ---
51
-
52
- # Requisitos
53
-
54
- Angular 18+
55
-
56
- Node.js 20+
57
-
58
- ---
59
-
60
- # Importación
61
-
62
- ## Utilidades
63
-
64
- ```ts
65
- import {
66
- DateUtil,
67
- MoneyUtil,
68
- DateFormats
69
- } from '@endesyc/format';
70
- ```
71
-
72
- ---
73
-
74
- ## Pipes
75
-
76
- ```ts
77
- import {
78
- CompanyDatePipe,
79
- CompanyMoneyPipe
80
- } from '@endesyc/format';
81
- ```
82
-
83
- ---
84
-
85
- # Fechas
86
-
87
- ## Fecha de ejemplo
88
-
89
- ```ts
90
- const createdAt = '2025-09-02 15:55:39.073';
91
- ```
92
-
93
- ---
94
-
95
- ## Solo fecha
96
-
97
- ```ts
98
- DateUtil.format(createdAt, DateFormats.DATE);
99
- ```
100
-
101
- Resultado
102
-
103
- ```
104
- 02/09/2025
105
- ```
106
-
107
- ---
108
-
109
- ## Solo hora
110
-
111
- ```ts
112
- DateUtil.format(createdAt, DateFormats.TIME);
113
- ```
114
-
115
- Resultado
116
-
117
- ```
118
- 15:55
119
- ```
120
-
121
- ---
122
-
123
- ## Fecha y hora
124
-
125
- ```ts
126
- DateUtil.format(createdAt, DateFormats.DATE_TIME);
127
- ```
128
-
129
- Resultado
130
-
131
- ```
132
- 02/09/2025 15:55
133
- ```
134
-
135
- ---
136
-
137
- ## Fecha y hora con segundos
138
-
139
- ```ts
140
- DateUtil.format(createdAt, DateFormats.DATE_TIME_SECONDS);
141
- ```
142
-
143
- Resultado
144
-
145
- ```
146
- 02/09/2025 15:55:39
147
- ```
148
-
149
- ---
150
-
151
- ## Mes y año
152
-
153
- ```ts
154
- DateUtil.format(createdAt, DateFormats.MONTH_YEAR);
155
- ```
156
-
157
- Resultado
158
-
159
- ```
160
- 09/2025
161
- ```
162
-
163
- ---
164
-
165
- ## Año
166
-
167
- ```ts
168
- DateUtil.format(createdAt, DateFormats.YEAR);
169
- ```
170
-
171
- Resultado
172
-
173
- ```
174
- 2025
175
- ```
176
-
177
- ---
178
-
179
- # HTML
180
-
181
- ## Fecha
182
-
183
- ```html
184
- {{ createdAt | companyDate:'date' }}
185
- ```
186
-
187
- Resultado
188
-
189
- ```
190
- 02/09/2025
191
- ```
192
-
193
- ---
194
-
195
- ## Hora
196
-
197
- ```html
198
- {{ createdAt | companyDate:'time' }}
199
- ```
200
-
201
- Resultado
202
-
203
- ```
204
- 15:55
205
- ```
206
-
207
- ---
208
-
209
- ## Fecha y Hora
210
-
211
- ```html
212
- {{ createdAt | companyDate:'dateTime' }}
213
- ```
214
-
215
- Resultado
216
-
217
- ```
218
- 02/09/2025 15:55
219
- ```
220
-
221
- ---
222
-
223
- ## Año
224
-
225
- ```html
226
- {{ createdAt | companyDate:'year' }}
227
- ```
228
-
229
- Resultado
230
-
231
- ```
232
- 2025
233
- ```
234
-
235
- ---
236
-
237
- # Dinero
238
-
239
- Monto de ejemplo
240
-
241
- ```ts
242
- const amount = 1234.56;
243
- ```
244
-
245
- ---
246
-
247
- ## Formato por defecto
248
-
249
- ```ts
250
- MoneyUtil.formatBolivianos(amount);
251
- ```
252
-
253
- Resultado
254
-
255
- ```
256
- Bs 1.234,56
257
- ```
258
-
259
- ---
260
-
261
- ## Sin símbolo
262
-
263
- ```ts
264
- MoneyUtil.formatBolivianos(amount,{
265
- showSymbol:false
266
- });
267
- ```
268
-
269
- Resultado
270
-
271
- ```
272
- 1.234,56
273
- ```
274
-
275
- ---
276
-
277
- ## Símbolo al final
278
-
279
- ```ts
280
- MoneyUtil.formatBolivianos(amount,{
281
- symbolPosition:'suffix'
282
- });
283
- ```
284
-
285
- Resultado
286
-
287
- ```
288
- 1.234,56 Bs
289
- ```
290
-
291
- ---
292
-
293
- ## Cuatro decimales
294
-
295
- ```ts
296
- MoneyUtil.formatBolivianos(amount,{
297
- maximumFractionDigits:4
298
- });
299
- ```
300
-
301
- Resultado
302
-
303
- ```
304
- Bs 1.234,5600
305
- ```
306
-
307
- ---
308
-
309
- # HTML
310
-
311
- ```html
312
- {{ amount | companyMoney }}
313
- ```
314
-
315
- Resultado
316
-
317
- ```
318
- Bs 1.234,56
319
- ```
320
-
321
- ---
322
-
323
- ## Sin símbolo
324
-
325
- ```html
326
- {{ amount | companyMoney:{showSymbol:false} }}
327
- ```
328
-
329
- ---
330
-
331
- ## Símbolo al final
332
-
333
- ```html
334
- {{ amount | companyMoney:{symbolPosition:'suffix'} }}
335
- ```
336
-
337
- ---
338
-
339
- # DateFormats
340
-
341
- La librería centraliza los formatos disponibles mediante la clase DateFormats.
342
-
343
- ```ts
344
- DateFormats.DATE
345
-
346
- DateFormats.TIME
347
-
348
- DateFormats.DATE_TIME
349
-
350
- DateFormats.DATE_TIME_SECONDS
351
-
352
- DateFormats.MONTH_YEAR
353
-
354
- DateFormats.YEAR
355
- ```
356
-
357
- ---
358
-
359
- # Validaciones
360
-
361
- ```ts
362
- DateUtil.isValid(value)
363
-
364
- MoneyUtil.isValid(value)
365
- ```
366
-
367
- ---
368
-
369
- # Conversión
370
-
371
- ```ts
372
- MoneyUtil.toNumber('1.234,56')
373
- ```
374
-
375
- ---
376
-
377
- # Estructura recomendada
378
-
379
- ```
380
- shared
381
-
382
- formatting.service.ts
383
-
384
- formatting.pipe.ts
385
-
386
- formatting.component.ts
387
- ```
388
-
389
- ---
390
-
391
- # Buenas prácticas
392
-
393
- ✔ Utilice DateFormats en lugar de escribir formatos manualmente.
394
-
395
- ✔ Reutilice los Pipes cuando sea posible.
396
-
397
- ✔ Evite hardcodear patrones de fechas.
398
-
399
- ✔ Mantenga todos los formatos corporativos centralizados.
400
-
401
- ---
402
-
403
- # Versionado
404
-
405
- Esta librería utiliza Semantic Versioning.
406
-
407
- ```
408
- MAJOR.MINOR.PATCH
409
- ```
410
-
411
- Ejemplos
412
-
413
- ```
414
- 1.0.0
415
-
416
- 1.0.1
417
-
418
- 1.1.0
419
-
420
- 2.0.0
421
- ```
422
-
423
- ---
424
-
425
- # Licencia
426
-
427
- Copyright © ENDESYC
428
-
1
+ # ENDESYC Format Library
2
+
3
+ Librería Angular compartida para fechas y montos.
4
+
5
+ ## Instalar
6
+ ```bash
7
+ npm install
8
+ npm test
9
+ npm run build
10
+ npm run pack
11
+ ```
12
+
13
+ ## Paquete
14
+ ```bash
15
+ npm install @endesyc/format@1.0.2
16
+ ```
17
+
18
+ # ENDESYC Format
19
+
20
+ Angular library for formatting dates, times and Bolivian currency.
21
+
22
+ ---
23
+
24
+ ## Características
25
+
26
+ ✔ Formateo de fechas
27
+
28
+ ✔ Formateo de horas
29
+
30
+ ✔ Formateo de fechas y horas
31
+
32
+ ✔ Formateo de moneda boliviana (BOB)
33
+
34
+ ✔ Pipes para Angular
35
+
36
+ ✔ Utilidades reutilizables
37
+
38
+ ✔ Soporte para valores nulos
39
+
40
+ ✔ Formatos centralizados mediante DateFormats
41
+
42
+ ---
43
+
44
+ # Instalación
45
+
46
+ ```bash
47
+ npm install @endesyc/format
48
+ ```
49
+
50
+ ---
51
+
52
+ # Requisitos
53
+
54
+ Angular 18+
55
+
56
+ Node.js 20+
57
+
58
+ ---
59
+
60
+ # Importación
61
+
62
+ ## Utilidades
63
+
64
+ ```ts
65
+ import {
66
+ DateUtil,
67
+ MoneyUtil,
68
+ DateFormats
69
+ } from '@endesyc/format';
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Pipes
75
+
76
+ ```ts
77
+ import {
78
+ CompanyDatePipe,
79
+ CompanyMoneyPipe
80
+ } from '@endesyc/format';
81
+ ```
82
+
83
+ ---
84
+
85
+ # Fechas
86
+
87
+ ## Fecha de ejemplo
88
+
89
+ ```ts
90
+ const createdAt = '2025-09-02 15:55:39.073';
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Solo fecha
96
+
97
+ ```ts
98
+ DateUtil.format(createdAt, DateFormats.DATE);
99
+ ```
100
+
101
+ Resultado
102
+
103
+ ```
104
+ 02/09/2025
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Solo hora
110
+
111
+ ```ts
112
+ DateUtil.format(createdAt, DateFormats.TIME);
113
+ ```
114
+
115
+ Resultado
116
+
117
+ ```
118
+ 15:55
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Fecha y hora
124
+
125
+ ```ts
126
+ DateUtil.format(createdAt, DateFormats.DATE_TIME);
127
+ ```
128
+
129
+ Resultado
130
+
131
+ ```
132
+ 02/09/2025 15:55
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Fecha y hora con segundos
138
+
139
+ ```ts
140
+ DateUtil.format(createdAt, DateFormats.DATE_TIME_SECONDS);
141
+ ```
142
+
143
+ Resultado
144
+
145
+ ```
146
+ 02/09/2025 15:55:39
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Mes y año
152
+
153
+ ```ts
154
+ DateUtil.format(createdAt, DateFormats.MONTH_YEAR);
155
+ ```
156
+
157
+ Resultado
158
+
159
+ ```
160
+ 09/2025
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Año
166
+
167
+ ```ts
168
+ DateUtil.format(createdAt, DateFormats.YEAR);
169
+ ```
170
+
171
+ Resultado
172
+
173
+ ```
174
+ 2025
175
+ ```
176
+
177
+ ---
178
+
179
+ # HTML
180
+
181
+ ## Fecha
182
+
183
+ ```html
184
+ {{ createdAt | companyDate:'date' }}
185
+ ```
186
+
187
+ Resultado
188
+
189
+ ```
190
+ 02/09/2025
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Hora
196
+
197
+ ```html
198
+ {{ createdAt | companyDate:'time' }}
199
+ ```
200
+
201
+ Resultado
202
+
203
+ ```
204
+ 15:55
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Fecha y Hora
210
+
211
+ ```html
212
+ {{ createdAt | companyDate:'dateTime' }}
213
+ ```
214
+
215
+ Resultado
216
+
217
+ ```
218
+ 02/09/2025 15:55
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Año
224
+
225
+ ```html
226
+ {{ createdAt | companyDate:'year' }}
227
+ ```
228
+
229
+ Resultado
230
+
231
+ ```
232
+ 2025
233
+ ```
234
+
235
+ ---
236
+
237
+ # Dinero
238
+
239
+ Monto de ejemplo
240
+
241
+ ```ts
242
+ const amount = 1234.56;
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Formato por defecto
248
+
249
+ ```ts
250
+ MoneyUtil.formatBolivianos(amount);
251
+ ```
252
+
253
+ Resultado
254
+
255
+ ```
256
+ Bs 1.234,56
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Sin símbolo
262
+
263
+ ```ts
264
+ MoneyUtil.formatBolivianos(amount,{
265
+ showSymbol:false
266
+ });
267
+ ```
268
+
269
+ Resultado
270
+
271
+ ```
272
+ 1.234,56
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Símbolo al final
278
+
279
+ ```ts
280
+ MoneyUtil.formatBolivianos(amount,{
281
+ symbolPosition:'suffix'
282
+ });
283
+ ```
284
+
285
+ Resultado
286
+
287
+ ```
288
+ 1.234,56 Bs
289
+ ```
290
+
291
+ ---
292
+
293
+ ## Cuatro decimales
294
+
295
+ ```ts
296
+ MoneyUtil.formatBolivianos(amount,{
297
+ maximumFractionDigits:4
298
+ });
299
+ ```
300
+
301
+ Resultado
302
+
303
+ ```
304
+ Bs 1.234,5600
305
+ ```
306
+
307
+ ---
308
+
309
+ # HTML
310
+
311
+ ```html
312
+ {{ amount | companyMoney }}
313
+ ```
314
+
315
+ Resultado
316
+
317
+ ```
318
+ Bs 1.234,56
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Sin símbolo
324
+
325
+ ```html
326
+ {{ amount | companyMoney:{showSymbol:false} }}
327
+ ```
328
+
329
+ ---
330
+
331
+ ## Símbolo al final
332
+
333
+ ```html
334
+ {{ amount | companyMoney:{symbolPosition:'suffix'} }}
335
+ ```
336
+
337
+ ---
338
+
339
+ # DateFormats
340
+
341
+ La librería centraliza los formatos disponibles mediante la clase DateFormats.
342
+
343
+ ```ts
344
+ DateFormats.DATE
345
+
346
+ DateFormats.TIME
347
+
348
+ DateFormats.DATE_TIME
349
+
350
+ DateFormats.DATE_TIME_SECONDS
351
+
352
+ DateFormats.MONTH_YEAR
353
+
354
+ DateFormats.YEAR
355
+ ```
356
+
357
+ ---
358
+
359
+ # Validaciones
360
+
361
+ ```ts
362
+ DateUtil.isValid(value)
363
+
364
+ MoneyUtil.isValid(value)
365
+ ```
366
+
367
+ ---
368
+
369
+ # Conversión
370
+
371
+ ```ts
372
+ MoneyUtil.toNumber('1.234,56')
373
+ ```
374
+
375
+ ---
376
+
377
+ # Estructura recomendada
378
+
379
+ ```
380
+ shared
381
+
382
+ formatting.service.ts
383
+
384
+ formatting.pipe.ts
385
+
386
+ formatting.component.ts
387
+ ```
388
+
389
+ ---
390
+
391
+ # Buenas prácticas
392
+
393
+ ✔ Utilice DateFormats en lugar de escribir formatos manualmente.
394
+
395
+ ✔ Reutilice los Pipes cuando sea posible.
396
+
397
+ ✔ Evite hardcodear patrones de fechas.
398
+
399
+ ✔ Mantenga todos los formatos corporativos centralizados.
400
+
401
+ ---
402
+
403
+ # Versionado
404
+
405
+ Esta librería utiliza Semantic Versioning.
406
+
407
+ ```
408
+ MAJOR.MINOR.PATCH
409
+ ```
410
+
411
+ Ejemplos
412
+
413
+ ```
414
+ 1.0.0
415
+
416
+ 1.0.1
417
+
418
+ 1.1.0
419
+
420
+ 2.0.0
421
+ ```
422
+
423
+ ---
424
+
425
+ # Licencia
426
+
427
+ Copyright © ENDESYC
428
+
429
429
  Todos los derechos reservados.
Binary file
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@endesyc/format",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Librería Angular compartida para formateo de fechas y montos monetarios.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ENDESYC",
7
7
  "sideEffects": false,
8
8
  "peerDependencies": {
9
- "@angular/common": ">=18 <21",
10
- "@angular/core": ">=18 <21",
9
+ "@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
10
+ "@angular/core": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
11
11
  "dayjs": "^1.11.13"
12
12
  },
13
13
  "dependencies": {