comand-component-library 4.2.40 → 4.2.41

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.
@@ -17524,6 +17524,24 @@ function Dv() {
17524
17524
  const e = /* @__PURE__ */ new Date(), t = String(e.getHours()).padStart(2, "0"), n = String(e.getMinutes()).padStart(2, "0");
17525
17525
  return t + ":" + n;
17526
17526
  }
17527
+ function Mv(e, t = "+", n = 1) {
17528
+ const s = new Date(e);
17529
+ if (t === "+")
17530
+ s.setDate(s.getDate() + n);
17531
+ else if (t === "-")
17532
+ s.setDate(s.getDate() - n);
17533
+ else
17534
+ throw new Error("function 'getDate()' received invalid operator as parameter. Use '+' to add or '-' to subtract days.");
17535
+ return s;
17536
+ }
17537
+ function Fv(e, t = "short") {
17538
+ const n = new Date(e), s = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], i = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
17539
+ if (t === "short")
17540
+ return s[n.getDay()];
17541
+ if (t === "long")
17542
+ return i[n.getDay()];
17543
+ throw new Error("Invalid format. Use 'short' or 'long'.");
17544
+ }
17527
17545
  function Tl(e, t = "dmy", n = ".") {
17528
17546
  const s = new Date(e);
17529
17547
  isNaN(s) && console.error("function 'formatDate()' received an invalid date as parameter. Provide date in format 'YYYY-MM-DD'");
@@ -20549,7 +20567,7 @@ const xx = /* @__PURE__ */ F(yx, [["render", bx]]), Cx = [
20549
20567
  text: "Zimbabwe",
20550
20568
  value: "zw"
20551
20569
  }
20552
- ], MC = "comand-component-library", FC = "4.2.40", VC = "GPL-3.0-only", AC = "CoManD-UI", PC = "module", EC = {
20570
+ ], MC = "comand-component-library", FC = "4.2.41", VC = "GPL-3.0-only", AC = "CoManD-UI", PC = "module", EC = {
20553
20571
  prepublishOnly: "npm run build-lib",
20554
20572
  dev: "vite",
20555
20573
  build: "vite build",
@@ -24679,7 +24697,7 @@ function wv(e, t, n, s, i, l) {
24679
24697
  [Pl]
24680
24698
  ]);
24681
24699
  }
24682
- const Mv = /* @__PURE__ */ F(YC, [["render", wv]]), Fv = {
24700
+ const Vv = /* @__PURE__ */ F(YC, [["render", wv]]), Av = {
24683
24701
  // el = real dom-element
24684
24702
  mounted(e) {
24685
24703
  if (e.tagName === "INPUT" || e.tagName === "SELECT" || e.tagName === "TEXTAREA" || e.tagName === "A")
@@ -24689,7 +24707,7 @@ const Mv = /* @__PURE__ */ F(YC, [["render", wv]]), Fv = {
24689
24707
  t ? t.focus() : console.warn("No input-element for focus-directive on element " + e.tagName + " found!");
24690
24708
  }
24691
24709
  }
24692
- }, Vv = {
24710
+ }, Pv = {
24693
24711
  // el = real dom-element
24694
24712
  // binding.value = value of v-directive
24695
24713
  mounted(e, t) {
@@ -24717,7 +24735,7 @@ function Tv(e) {
24717
24735
  }
24718
24736
  t.length > 0 && _l(t);
24719
24737
  }
24720
- const Av = (e) => {
24738
+ const Ev = (e) => {
24721
24739
  const t = e.querySelectorAll(".fancybox");
24722
24740
  _l(t), pt == null || pt.disconnect(), pt.observe(e, {
24723
24741
  subtree: !0,
@@ -24729,16 +24747,16 @@ const Av = (e) => {
24729
24747
  characterData: !1
24730
24748
  });
24731
24749
  };
24732
- function Pv(e) {
24750
+ function Hv(e) {
24733
24751
  return e ? e.slice(0, 1).toUpperCase() + e.slice(1) : "";
24734
24752
  }
24735
- function Ev(e) {
24753
+ function qv(e) {
24736
24754
  return e ? e.charAt(0).toLowerCase() + e.slice(1) : "";
24737
24755
  }
24738
- function Hv(...e) {
24756
+ function Rv(...e) {
24739
24757
  return e.filter((t) => typeof t == "string").map((t) => t.trim()).filter((t) => t.length > 0).join(" ");
24740
24758
  }
24741
- function qv() {
24759
+ function jv() {
24742
24760
  const e = {};
24743
24761
  Wl(s);
24744
24762
  function t(i = "defaultSequence") {
@@ -24773,7 +24791,7 @@ function Ov(e, t) {
24773
24791
  }).forEach((s) => t.push(s));
24774
24792
  }
24775
24793
  }
24776
- function Rv(e, t = 0) {
24794
+ function Nv(e, t = 0) {
24777
24795
  const n = [], s = Yl({
24778
24796
  activeItem: t,
24779
24797
  reset() {
@@ -24846,28 +24864,30 @@ export {
24846
24864
  gn as CmdTooltipForFormElements,
24847
24865
  mb as CmdUploadForm,
24848
24866
  vl as CmdWidthLimitationWrapper,
24849
- Mv as ComponentLibrary,
24867
+ Vv as ComponentLibrary,
24850
24868
  Mb as ContactInformation,
24851
- Av as DirFancybox,
24852
- Fv as DirFocus,
24853
- Vv as DirTelephone,
24869
+ Ev as DirFancybox,
24870
+ Av as DirFocus,
24871
+ Pv as DirTelephone,
24854
24872
  qe as EditComponentWrapper,
24855
24873
  ce as I18n,
24856
24874
  wb as MultipleBoxWrapper,
24857
24875
  Ob as MultipleListsOfLinks,
24858
- Pv as capitalizeFirstLetter,
24876
+ Hv as capitalizeFirstLetter,
24859
24877
  Vi as createHtmlId,
24860
24878
  it as createUuid,
24861
24879
  Bv as currentDate,
24862
24880
  Dv as currentTime,
24863
24881
  Tl as formatDate,
24864
24882
  Rb as formatTime,
24865
- Hv as fullName,
24883
+ Rv as fullName,
24866
24884
  Gi as getCookieDisclaimerCookie,
24885
+ Mv as getDate,
24867
24886
  $e as getFileExtension,
24868
- Ev as lowercaseFirstLetter,
24887
+ Fv as getWeekday,
24888
+ qv as lowercaseFirstLetter,
24869
24889
  we as openFancyBox,
24870
24890
  mm as setCookieDisclaimerCookie,
24871
- Rv as useScrollspy,
24872
- qv as useSequence
24891
+ Nv as useScrollspy,
24892
+ jv as useSequence
24873
24893
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "4.2.40",
3
+ "version": "4.2.41",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "CoManD-UI",
6
6
  "private": false,
package/src/index.js CHANGED
@@ -72,7 +72,7 @@ export { createUuid, createHtmlId } from '@/utils/common'
72
72
  export { getFileExtension } from '@/utils/getFileExtension'
73
73
  export { capitalizeFirstLetter, lowercaseFirstLetter, fullName } from '@/utils/string'
74
74
  export { setCookieDisclaimerCookie, getCookieDisclaimerCookie } from '@/utils/cookie'
75
- export { currentDate, currentTime, formatDate, formatTime } from "@/utils/date"
75
+ export { currentDate, currentTime, getDate, getWeekday, formatDate, formatTime } from "@/utils/date"
76
76
 
77
77
  // export composables
78
78
  export { useSequence } from '@/composables/sequence'
package/src/utils/date.js CHANGED
@@ -25,6 +25,25 @@ function getDate(inputDate, operator = "+", days = 1) {
25
25
  return date
26
26
  }
27
27
 
28
+ function getWeekday(dateString, format = "short") {
29
+ // Create date object from YYYY-MM-DD string
30
+ const date = new Date(dateString);
31
+
32
+ // Arrays for codes and full names
33
+ const codes = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
34
+ const fullNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
35
+
36
+ // Decide what to return
37
+ if (format === "short") {
38
+ return codes[date.getDay()];
39
+ } else if (format === "long") {
40
+ return fullNames[date.getDay()];
41
+ } else {
42
+ throw new Error("Invalid format. Use 'short' or 'long'.");
43
+ }
44
+ }
45
+
46
+
28
47
  function formatDate(inputDate, format = "dmy", separator= ".") {
29
48
  // Ensure the input is a valid date object or string
30
49
  const date = new Date(inputDate)
@@ -77,4 +96,4 @@ function formatTime(timeString = "00:00", format = 24, textAfter = "h") {
77
96
  }
78
97
  }
79
98
 
80
- export {currentDate, currentTime, formatDate, formatTime}
99
+ export {currentDate, currentTime, getDate, getWeekday, formatDate, formatTime}