@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260417054809 → 0.8.1-dev.20260417070529

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.js CHANGED
@@ -1863,82 +1863,6 @@ var OtpInput = (props) => {
1863
1863
  };
1864
1864
  var OtpInput_default = OtpInput;
1865
1865
 
1866
- // src/components/utilities/DateTimeUtility.tsx
1867
- var DateTimeUtility = class {
1868
- constructor() {
1869
- }
1870
- static formatDate(date) {
1871
- if (!date) {
1872
- throw new Error("Invalid date");
1873
- }
1874
- const pad = (num) => num.toString().padStart(2, "0");
1875
- const year = date.getFullYear();
1876
- const month = pad(date.getMonth() + 1);
1877
- const day = pad(date.getDate());
1878
- const hours = pad(date.getHours());
1879
- const minutes = pad(date.getMinutes());
1880
- const seconds = pad(date.getSeconds());
1881
- return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
1882
- }
1883
- static getMonthShortNameCustom(month) {
1884
- const monthNames = [
1885
- "Jan",
1886
- "Feb",
1887
- "Mar",
1888
- "Apr",
1889
- "May",
1890
- "Jun",
1891
- "Jul",
1892
- "Aug",
1893
- "Sep",
1894
- "Oct",
1895
- "Nov",
1896
- "Dec"
1897
- ];
1898
- if (month < 1 || month > 12) {
1899
- throw new Error(
1900
- "Invalid month. Please provide a value between 1 and 12."
1901
- );
1902
- }
1903
- return monthNames[month - 1];
1904
- }
1905
- static getCurrentWeekRange() {
1906
- const today = /* @__PURE__ */ new Date();
1907
- const day = today.getDay();
1908
- const diffToMonday = (day === 0 ? -6 : 1) - day;
1909
- const monday = new Date(today);
1910
- monday.setDate(today.getDate() + diffToMonday);
1911
- monday.setHours(0, 0, 0, 0);
1912
- const sunday = new Date(monday);
1913
- sunday.setDate(monday.getDate() + 6);
1914
- sunday.setHours(23, 59, 59, 999);
1915
- return { start: monday, end: sunday };
1916
- }
1917
- static getCurrentMonthRange() {
1918
- const now = /* @__PURE__ */ new Date();
1919
- const start = new Date(now.getFullYear(), now.getMonth(), 1);
1920
- const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
1921
- return { start, end };
1922
- }
1923
- static formatShortDate(date) {
1924
- const day = date.getDate();
1925
- const month = this.getMonthShortNameCustom(date.getMonth() + 1);
1926
- return `${day} ${month}`;
1927
- }
1928
- static formatIndianCurrencyShort(value) {
1929
- if (value >= 1e7) {
1930
- return `${(value / 1e7).toFixed(2)} Cr`;
1931
- } else if (value >= 1e5) {
1932
- return `${(value / 1e5).toFixed(2)} L`;
1933
- } else if (value >= 1e3) {
1934
- return `${(value / 1e3).toFixed(2)} K`;
1935
- } else {
1936
- return `${value}`;
1937
- }
1938
- }
1939
- };
1940
- var DateTimeUtility_default = DateTimeUtility;
1941
-
1942
1866
  // src/components/controls/edit/DateTimeInput.tsx
1943
1867
  var import_react19 = __toESM(require("react"));
1944
1868
  var import_jsx_runtime20 = require("react/jsx-runtime");
@@ -1946,13 +1870,10 @@ var DateTimeInput = (props) => {
1946
1870
  const textChangeHandler = (event) => {
1947
1871
  const localDate = new Date(event.target.value);
1948
1872
  if (props.callback !== void 0) {
1949
- const utcDate = new Date(
1950
- localDate.getTime() + localDate.getTimezoneOffset() * 6e4
1951
- );
1952
- let formattedDate = DateTimeUtility_default.formatDate(utcDate);
1873
+ const utcISOString = localDate.toISOString();
1953
1874
  props.callback({
1954
1875
  name: props.name,
1955
- value: formattedDate,
1876
+ value: utcISOString,
1956
1877
  index: props.index,
1957
1878
  groupKey: props.groupKey
1958
1879
  });
@@ -1962,18 +1883,12 @@ var DateTimeInput = (props) => {
1962
1883
  let localvalue;
1963
1884
  let timeZoneAbbr;
1964
1885
  const now = /* @__PURE__ */ new Date();
1965
- if (props.value !== void 0 && props.value !== null) {
1966
- value = props.value;
1967
- const now2 = /* @__PURE__ */ new Date();
1968
- const offsetMinutes = now2.getTimezoneOffset();
1969
- const offsetMilliseconds = offsetMinutes * 60 * 1e3;
1970
- const valDate = value.toString().includes("Z") ? (
1971
- // @ts-ignore
1972
- new Date(value)
1973
- ) : /* @__PURE__ */ new Date(value + "Z");
1974
- let localDate = new Date(valDate.getTime() - offsetMilliseconds);
1975
- timeZoneAbbr = now2.toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
1976
- localvalue = localDate?.toISOString()?.slice(0, 16);
1886
+ if (props.value) {
1887
+ const utcDate = new Date(props.value);
1888
+ localvalue = new Date(
1889
+ utcDate.getTime() - utcDate.getTimezoneOffset() * 6e4
1890
+ ).toISOString().slice(0, 16);
1891
+ timeZoneAbbr = (/* @__PURE__ */ new Date()).toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
1977
1892
  }
1978
1893
  const handleKeyDown = (e) => {
1979
1894
  if (e.key === "Backspace") {
package/dist/index.mjs CHANGED
@@ -875,82 +875,6 @@ var OtpInput = (props) => {
875
875
  };
876
876
  var OtpInput_default = OtpInput;
877
877
 
878
- // src/components/utilities/DateTimeUtility.tsx
879
- var DateTimeUtility = class {
880
- constructor() {
881
- }
882
- static formatDate(date) {
883
- if (!date) {
884
- throw new Error("Invalid date");
885
- }
886
- const pad = (num) => num.toString().padStart(2, "0");
887
- const year = date.getFullYear();
888
- const month = pad(date.getMonth() + 1);
889
- const day = pad(date.getDate());
890
- const hours = pad(date.getHours());
891
- const minutes = pad(date.getMinutes());
892
- const seconds = pad(date.getSeconds());
893
- return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
894
- }
895
- static getMonthShortNameCustom(month) {
896
- const monthNames = [
897
- "Jan",
898
- "Feb",
899
- "Mar",
900
- "Apr",
901
- "May",
902
- "Jun",
903
- "Jul",
904
- "Aug",
905
- "Sep",
906
- "Oct",
907
- "Nov",
908
- "Dec"
909
- ];
910
- if (month < 1 || month > 12) {
911
- throw new Error(
912
- "Invalid month. Please provide a value between 1 and 12."
913
- );
914
- }
915
- return monthNames[month - 1];
916
- }
917
- static getCurrentWeekRange() {
918
- const today = /* @__PURE__ */ new Date();
919
- const day = today.getDay();
920
- const diffToMonday = (day === 0 ? -6 : 1) - day;
921
- const monday = new Date(today);
922
- monday.setDate(today.getDate() + diffToMonday);
923
- monday.setHours(0, 0, 0, 0);
924
- const sunday = new Date(monday);
925
- sunday.setDate(monday.getDate() + 6);
926
- sunday.setHours(23, 59, 59, 999);
927
- return { start: monday, end: sunday };
928
- }
929
- static getCurrentMonthRange() {
930
- const now = /* @__PURE__ */ new Date();
931
- const start = new Date(now.getFullYear(), now.getMonth(), 1);
932
- const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
933
- return { start, end };
934
- }
935
- static formatShortDate(date) {
936
- const day = date.getDate();
937
- const month = this.getMonthShortNameCustom(date.getMonth() + 1);
938
- return `${day} ${month}`;
939
- }
940
- static formatIndianCurrencyShort(value) {
941
- if (value >= 1e7) {
942
- return `${(value / 1e7).toFixed(2)} Cr`;
943
- } else if (value >= 1e5) {
944
- return `${(value / 1e5).toFixed(2)} L`;
945
- } else if (value >= 1e3) {
946
- return `${(value / 1e3).toFixed(2)} K`;
947
- } else {
948
- return `${value}`;
949
- }
950
- }
951
- };
952
- var DateTimeUtility_default = DateTimeUtility;
953
-
954
878
  // src/components/controls/edit/DateTimeInput.tsx
955
879
  import React19 from "react";
956
880
  import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
@@ -958,13 +882,10 @@ var DateTimeInput = (props) => {
958
882
  const textChangeHandler = (event) => {
959
883
  const localDate = new Date(event.target.value);
960
884
  if (props.callback !== void 0) {
961
- const utcDate = new Date(
962
- localDate.getTime() + localDate.getTimezoneOffset() * 6e4
963
- );
964
- let formattedDate = DateTimeUtility_default.formatDate(utcDate);
885
+ const utcISOString = localDate.toISOString();
965
886
  props.callback({
966
887
  name: props.name,
967
- value: formattedDate,
888
+ value: utcISOString,
968
889
  index: props.index,
969
890
  groupKey: props.groupKey
970
891
  });
@@ -974,18 +895,12 @@ var DateTimeInput = (props) => {
974
895
  let localvalue;
975
896
  let timeZoneAbbr;
976
897
  const now = /* @__PURE__ */ new Date();
977
- if (props.value !== void 0 && props.value !== null) {
978
- value = props.value;
979
- const now2 = /* @__PURE__ */ new Date();
980
- const offsetMinutes = now2.getTimezoneOffset();
981
- const offsetMilliseconds = offsetMinutes * 60 * 1e3;
982
- const valDate = value.toString().includes("Z") ? (
983
- // @ts-ignore
984
- new Date(value)
985
- ) : /* @__PURE__ */ new Date(value + "Z");
986
- let localDate = new Date(valDate.getTime() - offsetMilliseconds);
987
- timeZoneAbbr = now2.toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
988
- localvalue = localDate?.toISOString()?.slice(0, 16);
898
+ if (props.value) {
899
+ const utcDate = new Date(props.value);
900
+ localvalue = new Date(
901
+ utcDate.getTime() - utcDate.getTimezoneOffset() * 6e4
902
+ ).toISOString().slice(0, 16);
903
+ timeZoneAbbr = (/* @__PURE__ */ new Date()).toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
989
904
  }
990
905
  const handleKeyDown = (e) => {
991
906
  if (e.key === "Backspace") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260417054809",
3
+ "version": "0.8.1-dev.20260417070529",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",