@base-web-kits/base-tools-ts 1.3.8 → 1.3.11

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/dist/index.mjs CHANGED
@@ -3054,6 +3054,10 @@ function toDayjs(t, fmt) {
3054
3054
  }
3055
3055
  return dayjs(t, fmt);
3056
3056
  }
3057
+ function dateFormat(t, fmt = "YYYY-MM-DD HH:mm:ss") {
3058
+ if (!t) return "";
3059
+ return toDayjs(t).format(fmt);
3060
+ }
3057
3061
  function getDateRangeBefore(offset, fmt = "YYYY-MM-DD") {
3058
3062
  const now = toDayjs(Date.now());
3059
3063
  const n = Math.max(0, Math.trunc(offset));
@@ -3965,6 +3969,7 @@ export {
3965
3969
  createViewRandId,
3966
3970
  curry,
3967
3971
  curryRight,
3972
+ dateFormat,
3968
3973
  dayjs,
3969
3974
  debounce,
3970
3975
  deburr,