diff --git a/dist/index.cjs b/dist/index.cjs index 193d368..01a6004 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -1,7 +1,7 @@ 'use strict'; const z = require('zod'); -const dayjsbr = require('dayjs'); +const dayjs = require('dayjs'); const duration = require('dayjs/plugin/duration.js'); const isSameOrAfter = require('dayjs/plugin/isSameOrAfter.js'); const isSameOrBefore = require('dayjs/plugin/isSameOrBefore.js'); @@ -10,13 +10,14 @@ const relativeTime = require('dayjs/plugin/relativeTime.js'); const timezone = require('dayjs/plugin/timezone.js'); const utc = require('dayjs/plugin/utc.js'); const weekOfYear = require('dayjs/plugin/weekOfYear.js'); +require('dayjs/locale/pt-br.js'); const crossFetch = require('cross-fetch'); const uuid$1 = require('uuid'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } const z__default = /*#__PURE__*/_interopDefaultCompat(z); -const dayjsbr__default = /*#__PURE__*/_interopDefaultCompat(dayjsbr); +const dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs); const duration__default = /*#__PURE__*/_interopDefaultCompat(duration); const isSameOrAfter__default = /*#__PURE__*/_interopDefaultCompat(isSameOrAfter); const isSameOrBefore__default = /*#__PURE__*/_interopDefaultCompat(isSameOrBefore); @@ -100,14 +101,16 @@ const zFiltro = z__default.object({ ou: z__default.boolean().optional() }); -dayjsbr__default.extend(utc__default); -dayjsbr__default.extend(timezone__default); -dayjsbr__default.extend(weekOfYear__default); -dayjsbr__default.extend(isSameOrBefore__default); -dayjsbr__default.extend(isSameOrAfter__default); -dayjsbr__default.extend(minMax__default); -dayjsbr__default.extend(relativeTime__default); -dayjsbr__default.extend(duration__default); +dayjs__default.locale("pt-br"); +dayjs__default.extend(utc__default); +dayjs__default.extend(timezone__default); +dayjs__default.extend(weekOfYear__default); +dayjs__default.extend(isSameOrBefore__default); +dayjs__default.extend(isSameOrAfter__default); +dayjs__default.extend(minMax__default); +dayjs__default.extend(relativeTime__default); +dayjs__default.extend(duration__default); +const dayjsbr = dayjs__default; const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; @@ -558,7 +561,7 @@ const uuidV3 = (chave, grupo) => { const uuidV4 = uuid$1.v4; const uuid = uuidV4; -exports.dayjsbr = dayjsbr__default; +exports.dayjs = dayjs__default; exports.TipagemRotas = TipagemRotas; exports.aleatorio = aleatorio; exports.cacheM = cacheM; @@ -566,6 +569,7 @@ exports.cacheMFixo = cacheMFixo; exports.cacheMemoria = cacheMemoria; exports.camposComuns = camposComuns; exports.cdn_carro_de_boi = cdn_carro_de_boi; +exports.dayjsbr = dayjsbr; exports.defineCwd = defineCwd; exports.erUuid = erUuid; exports.esperar = esperar; diff --git a/dist/index.d.cts b/dist/index.d.cts index b8077fa..66c2e30 100644 --- a/dist/index.d.cts +++ b/dist/index.d.cts @@ -1,5 +1,6 @@ import z from 'zod'; -export { ManipulateType, default as dayjsbr } from 'dayjs'; +import dayjs from 'dayjs'; +export { ManipulateType, default as dayjs } from 'dayjs'; import { v4 } from 'uuid'; declare const aleatorio: (tamanho?: number) => string; @@ -89,6 +90,8 @@ declare const zFiltro: z.ZodObject<{ ou: z.ZodOptional; }, z.core.$strip>; +declare const dayjsbr: typeof dayjs; + declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros"; @@ -308,5 +311,5 @@ declare const nomeVariavel: (v: { [key: string]: any; }) => string; -export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; +export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; export type { TipoLoggerSessao, interfaceConsulta, tipoFiltro, tipoLogger, tipoLoggerLog, tipoLokiObjeto }; diff --git a/dist/index.d.mts b/dist/index.d.mts index b8077fa..66c2e30 100644 --- a/dist/index.d.mts +++ b/dist/index.d.mts @@ -1,5 +1,6 @@ import z from 'zod'; -export { ManipulateType, default as dayjsbr } from 'dayjs'; +import dayjs from 'dayjs'; +export { ManipulateType, default as dayjs } from 'dayjs'; import { v4 } from 'uuid'; declare const aleatorio: (tamanho?: number) => string; @@ -89,6 +90,8 @@ declare const zFiltro: z.ZodObject<{ ou: z.ZodOptional; }, z.core.$strip>; +declare const dayjsbr: typeof dayjs; + declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros"; @@ -308,5 +311,5 @@ declare const nomeVariavel: (v: { [key: string]: any; }) => string; -export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; +export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; export type { TipoLoggerSessao, interfaceConsulta, tipoFiltro, tipoLogger, tipoLoggerLog, tipoLokiObjeto }; diff --git a/dist/index.d.ts b/dist/index.d.ts index b8077fa..66c2e30 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,5 +1,6 @@ import z from 'zod'; -export { ManipulateType, default as dayjsbr } from 'dayjs'; +import dayjs from 'dayjs'; +export { ManipulateType, default as dayjs } from 'dayjs'; import { v4 } from 'uuid'; declare const aleatorio: (tamanho?: number) => string; @@ -89,6 +90,8 @@ declare const zFiltro: z.ZodObject<{ ou: z.ZodOptional; }, z.core.$strip>; +declare const dayjsbr: typeof dayjs; + declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros"; @@ -308,5 +311,5 @@ declare const nomeVariavel: (v: { [key: string]: any; }) => string; -export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; +export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; export type { TipoLoggerSessao, interfaceConsulta, tipoFiltro, tipoLogger, tipoLoggerLog, tipoLokiObjeto }; diff --git a/dist/index.mjs b/dist/index.mjs index 8602ee3..ac3fdc4 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,6 +1,6 @@ import z from 'zod'; -import dayjsbr from 'dayjs'; -export { default as dayjsbr } from 'dayjs'; +import dayjs from 'dayjs'; +export { default as dayjs } from 'dayjs'; import duration from 'dayjs/plugin/duration.js'; import isSameOrAfter from 'dayjs/plugin/isSameOrAfter.js'; import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; @@ -9,6 +9,7 @@ import relativeTime from 'dayjs/plugin/relativeTime.js'; import timezone from 'dayjs/plugin/timezone.js'; import utc from 'dayjs/plugin/utc.js'; import weekOfYear from 'dayjs/plugin/weekOfYear.js'; +import 'dayjs/locale/pt-br.js'; import crossFetch from 'cross-fetch'; import { v4, v3, NIL } from 'uuid'; @@ -85,14 +86,16 @@ const zFiltro = z.object({ ou: z.boolean().optional() }); -dayjsbr.extend(utc); -dayjsbr.extend(timezone); -dayjsbr.extend(weekOfYear); -dayjsbr.extend(isSameOrBefore); -dayjsbr.extend(isSameOrAfter); -dayjsbr.extend(minMax); -dayjsbr.extend(relativeTime); -dayjsbr.extend(duration); +dayjs.locale("pt-br"); +dayjs.extend(utc); +dayjs.extend(timezone); +dayjs.extend(weekOfYear); +dayjs.extend(isSameOrBefore); +dayjs.extend(isSameOrAfter); +dayjs.extend(minMax); +dayjs.extend(relativeTime); +dayjs.extend(duration); +const dayjsbr = dayjs; const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; @@ -543,4 +546,4 @@ const uuidV3 = (chave, grupo) => { const uuidV4 = v4; const uuid = uuidV4; -export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; +export { TipagemRotas, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; diff --git a/package.json b/package.json index 47901c3..9cd6212 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p-comuns", - "version": "0.274.0", + "version": "0.275.0", "description": "", "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/src/dayjs.ts b/src/dayjs.ts index 6268b51..6938958 100644 --- a/src/dayjs.ts +++ b/src/dayjs.ts @@ -1,4 +1,4 @@ -import dayjsbr from "dayjs" +import dayjs from "dayjs" export type { ManipulateType } from "dayjs" @@ -10,14 +10,18 @@ import relativeTime from "dayjs/plugin/relativeTime.js" import timezone from "dayjs/plugin/timezone.js" import utc from "dayjs/plugin/utc.js" import weekOfYear from "dayjs/plugin/weekOfYear.js" +import "dayjs/locale/pt-br.js" +dayjs.locale("pt-br") -dayjsbr.extend(utc) -dayjsbr.extend(timezone) -dayjsbr.extend(weekOfYear) -dayjsbr.extend(isSameOrBefore) -dayjsbr.extend(isSameOrAfter) -dayjsbr.extend(minMax) -dayjsbr.extend(relativeTime) -dayjsbr.extend(duration) +dayjs.extend(utc) +dayjs.extend(timezone) +dayjs.extend(weekOfYear) +dayjs.extend(isSameOrBefore) +dayjs.extend(isSameOrAfter) +dayjs.extend(minMax) +dayjs.extend(relativeTime) +dayjs.extend(duration) -export { dayjsbr } +export const dayjsbr = dayjs + +export { dayjs }