mado-ui 0.5.3 → 0.5.5

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.
Files changed (83) hide show
  1. package/css/index.css +189 -1
  2. package/dist/components/form/index.d.ts +1 -0
  3. package/dist/components/form/index.d.ts.map +1 -1
  4. package/dist/components/form/input/date/index.d.ts +36 -16
  5. package/dist/components/form/input/date/index.d.ts.map +1 -1
  6. package/dist/components/form/input/date/views/calendar-view.d.ts +2 -0
  7. package/dist/components/form/input/date/views/calendar-view.d.ts.map +1 -0
  8. package/dist/components/form/input/date/views/clock-view.d.ts +2 -0
  9. package/dist/components/form/input/date/views/clock-view.d.ts.map +1 -0
  10. package/dist/components/form/input/date/views/dropdown-view.d.ts +2 -0
  11. package/dist/components/form/input/date/views/dropdown-view.d.ts.map +1 -0
  12. package/dist/components/form/input/date/views/index.d.ts +5 -0
  13. package/dist/components/form/input/date/views/index.d.ts.map +1 -0
  14. package/dist/components/form/input/date/views/rotary-view.d.ts +2 -0
  15. package/dist/components/form/input/date/views/rotary-view.d.ts.map +1 -0
  16. package/dist/components/form/input/date/views/view-handler.d.ts +21 -0
  17. package/dist/components/form/input/date/views/view-handler.d.ts.map +1 -0
  18. package/dist/components/form/input/index.d.ts +4 -87
  19. package/dist/components/form/input/index.d.ts.map +1 -1
  20. package/dist/components/form/input/input-types.d.ts +102 -0
  21. package/dist/components/form/input/input-types.d.ts.map +1 -0
  22. package/dist/components/form/input/number-input.d.ts +4 -0
  23. package/dist/components/form/input/number-input.d.ts.map +1 -0
  24. package/dist/components/form/input/text-input.d.ts +36 -0
  25. package/dist/components/form/input/text-input.d.ts.map +1 -0
  26. package/dist/components/form/select.d.ts +41 -0
  27. package/dist/components/form/select.d.ts.map +1 -0
  28. package/dist/components.d.ts +161 -62
  29. package/dist/components.esm.js +482 -183
  30. package/dist/components.esm.js.map +1 -1
  31. package/dist/components.js +481 -181
  32. package/dist/components.js.map +1 -1
  33. package/dist/graphics/index.d.ts +2 -0
  34. package/dist/graphics/index.d.ts.map +1 -0
  35. package/dist/graphics/social-media/facebook-logo.d.ts +33 -0
  36. package/dist/graphics/social-media/facebook-logo.d.ts.map +1 -0
  37. package/dist/graphics/social-media/google-logo.d.ts +13 -0
  38. package/dist/graphics/social-media/google-logo.d.ts.map +1 -0
  39. package/dist/graphics/social-media/index.d.ts +8 -0
  40. package/dist/graphics/social-media/index.d.ts.map +1 -0
  41. package/dist/graphics/social-media/instagram-logo.d.ts +13 -0
  42. package/dist/graphics/social-media/instagram-logo.d.ts.map +1 -0
  43. package/dist/graphics/social-media/linkedin-logo.d.ts +26 -0
  44. package/dist/graphics/social-media/linkedin-logo.d.ts.map +1 -0
  45. package/dist/graphics/social-media/tiktok-logo.d.ts +26 -0
  46. package/dist/graphics/social-media/tiktok-logo.d.ts.map +1 -0
  47. package/dist/graphics/social-media/x-logo.d.ts +6 -0
  48. package/dist/graphics/social-media/x-logo.d.ts.map +1 -0
  49. package/dist/graphics/social-media/youtube-logo.d.ts +26 -0
  50. package/dist/graphics/social-media/youtube-logo.d.ts.map +1 -0
  51. package/dist/graphics.d.ts +141 -0
  52. package/dist/graphics.d.ts.map +1 -0
  53. package/dist/graphics.esm.js +241 -0
  54. package/dist/graphics.esm.js.map +1 -0
  55. package/dist/graphics.js +249 -0
  56. package/dist/graphics.js.map +1 -0
  57. package/dist/hooks/use-fieldset-context.d.ts.map +1 -1
  58. package/dist/hooks/use-form-context.d.ts +5 -5
  59. package/dist/hooks/use-form-context.d.ts.map +1 -1
  60. package/dist/hooks.d.ts +5 -5
  61. package/dist/hooks.esm.js.map +1 -1
  62. package/dist/hooks.js.map +1 -1
  63. package/dist/index.d.ts +161 -62
  64. package/dist/index.esm.js +482 -183
  65. package/dist/index.esm.js.map +1 -1
  66. package/dist/index.js +481 -181
  67. package/dist/index.js.map +1 -1
  68. package/dist/utils/get-date.d.ts +32 -20
  69. package/dist/utils/get-date.d.ts.map +1 -1
  70. package/dist/utils/string-manipulation.d.ts +23 -1
  71. package/dist/utils/string-manipulation.d.ts.map +1 -1
  72. package/dist/utils.d.ts +57 -23
  73. package/dist/utils.esm.js +1139 -57
  74. package/dist/utils.esm.js.map +1 -1
  75. package/dist/utils.js +1145 -58
  76. package/dist/utils.js.map +1 -1
  77. package/package.json +100 -96
  78. package/dist/components/mado-ui-provider.d.ts +0 -1
  79. package/dist/hooks/use-anime-scope.d.ts +0 -15
  80. package/dist/types.esm.js +0 -2
  81. package/dist/types.esm.js.map +0 -1
  82. package/dist/types.js +0 -3
  83. package/dist/types.js.map +0 -1
package/dist/utils.js CHANGED
@@ -352,6 +352,1008 @@ function extendMadoTailwindMerge(configExtension) {
352
352
  });
353
353
  }
354
354
 
355
+ const timezoneList = [
356
+ {
357
+ abbr: 'ACDT',
358
+ name: 'Australian Central Daylight Time',
359
+ offset: ['+', 10, 30],
360
+ },
361
+ {
362
+ abbr: 'ACST',
363
+ name: 'Australian Central Standard Time',
364
+ offset: ['+', 9, 30],
365
+ },
366
+ {
367
+ abbr: 'ACT',
368
+ name: 'Acre Time',
369
+ offset: ['-', 5, 0],
370
+ },
371
+ {
372
+ abbr: 'ACWST',
373
+ name: 'Australian Central Western Standard Time',
374
+ offset: ['+', 8, 45],
375
+ },
376
+ {
377
+ abbr: 'ADT',
378
+ name: 'Atlantic Daylight Time',
379
+ offset: ['-', 3, 0],
380
+ },
381
+ {
382
+ abbr: 'AEDT',
383
+ name: 'Australian Eastern Daylight Savings Time',
384
+ offset: ['+', 11, 0],
385
+ },
386
+ {
387
+ abbr: 'AEST',
388
+ name: 'Australian Eastern Standard Time',
389
+ offset: ['+', 10, 0],
390
+ },
391
+ {
392
+ abbr: 'AFT',
393
+ name: 'Afghanistan Time',
394
+ offset: ['+', 4, 30],
395
+ },
396
+ {
397
+ abbr: 'AKDT',
398
+ name: 'Alaska Daylight Time',
399
+ offset: ['-', 8, 0],
400
+ },
401
+ {
402
+ abbr: 'AKST',
403
+ name: 'Alaska Standard Time',
404
+ offset: ['-', 9, 0],
405
+ },
406
+ {
407
+ abbr: 'AMST',
408
+ name: 'Amazon Summer Time',
409
+ offset: ['-', 3, 0],
410
+ },
411
+ {
412
+ abbr: 'AMT',
413
+ name: 'Amazon Time',
414
+ offset: ['-', 4, 0],
415
+ },
416
+ {
417
+ abbr: 'AMT',
418
+ name: 'Armenia Time',
419
+ offset: ['+', 4, 0],
420
+ },
421
+ {
422
+ abbr: 'ART',
423
+ name: 'Argentina Time',
424
+ offset: ['-', 3, 0],
425
+ },
426
+ {
427
+ abbr: 'AST',
428
+ name: 'Atlantic Standard Time',
429
+ offset: ['-', 4, 0],
430
+ },
431
+ {
432
+ abbr: 'AST',
433
+ name: 'Arabia Standard Time',
434
+ offset: ['+', 3, 0],
435
+ },
436
+ {
437
+ abbr: 'AT',
438
+ name: 'Atlantic Time',
439
+ offset: ['-', 4, 0],
440
+ },
441
+ {
442
+ abbr: 'AWST',
443
+ name: 'Australian Western Standard Time',
444
+ offset: ['+', 8, 0],
445
+ },
446
+ {
447
+ abbr: 'AZOST',
448
+ name: 'Azores Summer Time',
449
+ offset: ['+', 0, 0],
450
+ },
451
+ {
452
+ abbr: 'AZOT',
453
+ name: 'Azores Standard Time',
454
+ offset: ['-', 1, 0],
455
+ },
456
+ {
457
+ abbr: 'AZT',
458
+ name: 'Azerbaijan Time',
459
+ offset: ['+', 4, 0],
460
+ },
461
+ {
462
+ abbr: 'BDT',
463
+ name: 'Brunei Time',
464
+ offset: ['+', 8, 0],
465
+ },
466
+ {
467
+ abbr: 'BIT',
468
+ name: 'Baker Island Time',
469
+ offset: ['-', 12, 0],
470
+ },
471
+ {
472
+ abbr: 'BNT',
473
+ name: 'Brunei Darussalam Time',
474
+ offset: ['+', 8, 0],
475
+ },
476
+ {
477
+ abbr: 'BOT',
478
+ name: 'Bolivia Time',
479
+ offset: ['-', 4, 0],
480
+ },
481
+ {
482
+ abbr: 'BRST',
483
+ name: 'Brasilia Summer Time',
484
+ offset: ['-', 2, 0],
485
+ },
486
+ {
487
+ abbr: 'BRT',
488
+ name: 'Brasilia Time',
489
+ offset: ['-', 3, 0],
490
+ },
491
+ {
492
+ abbr: 'BST',
493
+ name: 'British Summer Time',
494
+ offset: ['+', 1, 0],
495
+ },
496
+ {
497
+ abbr: 'BST',
498
+ name: 'Bangladesh Standard Time',
499
+ offset: ['+', 6, 0],
500
+ },
501
+ {
502
+ abbr: 'BST',
503
+ name: 'Bougainville Standard Time',
504
+ offset: ['+', 11, 0],
505
+ },
506
+ {
507
+ abbr: 'BTT',
508
+ name: 'Bhutan Time',
509
+ offset: ['+', 6, 0],
510
+ },
511
+ {
512
+ abbr: 'CAT',
513
+ name: 'Central Africa Time',
514
+ offset: ['+', 2, 0],
515
+ },
516
+ {
517
+ abbr: 'CCT',
518
+ name: 'Cocos Islands Time',
519
+ offset: ['+', 6, 30],
520
+ },
521
+ {
522
+ abbr: 'CDT',
523
+ name: 'Central Daylight Time',
524
+ offset: ['-', 5, 0],
525
+ },
526
+ {
527
+ abbr: 'CDT',
528
+ name: 'Cuba Daylight Time',
529
+ offset: ['-', 4, 0],
530
+ },
531
+ {
532
+ abbr: 'CEST',
533
+ name: 'Central European Summer Time',
534
+ offset: ['+', 2, 0],
535
+ },
536
+ {
537
+ abbr: 'CET',
538
+ name: 'Central European Time',
539
+ offset: ['+', 1, 0],
540
+ },
541
+ {
542
+ abbr: 'CHADT',
543
+ name: 'Chatham Daylight Time',
544
+ offset: ['+', 13, 45],
545
+ },
546
+ {
547
+ abbr: 'CHAST',
548
+ name: 'Chatham Standard Time',
549
+ offset: ['+', 12, 45],
550
+ },
551
+ {
552
+ abbr: 'CHOST',
553
+ name: 'Choibalsan Summer Time',
554
+ offset: ['+', 9, 0],
555
+ },
556
+ {
557
+ abbr: 'CHOT',
558
+ name: 'Choibalsan Standard Time',
559
+ offset: ['+', 8, 0],
560
+ },
561
+ {
562
+ abbr: 'CHST',
563
+ name: 'Chamorro Standard Time',
564
+ offset: ['+', 10, 0],
565
+ },
566
+ {
567
+ abbr: 'CHUT',
568
+ name: 'Chuuk Time',
569
+ offset: ['+', 10, 0],
570
+ },
571
+ {
572
+ abbr: 'CIST',
573
+ name: 'Clipperton Island Standard Time',
574
+ offset: ['-', 8, 0],
575
+ },
576
+ {
577
+ abbr: 'CIT',
578
+ name: 'Central Indonesia Time',
579
+ offset: ['+', 8, 0],
580
+ },
581
+ {
582
+ abbr: 'CKT',
583
+ name: 'Cook Island Time',
584
+ offset: ['-', 10, 0],
585
+ },
586
+ {
587
+ abbr: 'CLST',
588
+ name: 'Chile Summer Time',
589
+ offset: ['-', 3, 0],
590
+ },
591
+ {
592
+ abbr: 'CLT',
593
+ name: 'Chile Standard Time',
594
+ offset: ['-', 4, 0],
595
+ },
596
+ {
597
+ abbr: 'COST',
598
+ name: 'Colombia Summer Time',
599
+ offset: ['-', 4, 0],
600
+ },
601
+ {
602
+ abbr: 'COT',
603
+ name: 'Colombia Time',
604
+ offset: ['-', 5, 0],
605
+ },
606
+ {
607
+ abbr: 'CST',
608
+ name: 'Central Standard Time',
609
+ offset: ['-', 6, 0],
610
+ },
611
+ {
612
+ abbr: 'CST',
613
+ name: 'China Standard Time',
614
+ offset: ['+', 8, 0],
615
+ },
616
+ {
617
+ abbr: 'CST',
618
+ name: 'Cuba Standard Time',
619
+ offset: ['-', 5, 0],
620
+ },
621
+ {
622
+ abbr: 'CT',
623
+ name: 'Central Time',
624
+ offset: ['-', 6, 0],
625
+ },
626
+ {
627
+ abbr: 'CVT',
628
+ name: 'Cape Verde Time',
629
+ offset: ['-', 1, 0],
630
+ },
631
+ {
632
+ abbr: 'CWST',
633
+ name: 'Central Western Standard Time',
634
+ offset: ['+', 8, 45],
635
+ },
636
+ {
637
+ abbr: 'CXT',
638
+ name: 'Christmas Island Time',
639
+ offset: ['+', 7, 0],
640
+ },
641
+ {
642
+ abbr: 'DAVT',
643
+ name: 'Davis Time',
644
+ offset: ['+', 7, 0],
645
+ },
646
+ {
647
+ abbr: 'DDUT',
648
+ name: "Dumont d'Urville Time",
649
+ offset: ['+', 10, 0],
650
+ },
651
+ {
652
+ abbr: 'EASST',
653
+ name: 'Easter Island Summer Time',
654
+ offset: ['-', 5, 0],
655
+ },
656
+ {
657
+ abbr: 'EAST',
658
+ name: 'Easter Island Standard Time',
659
+ offset: ['-', 6, 0],
660
+ },
661
+ {
662
+ abbr: 'EAT',
663
+ name: 'East Africa Time',
664
+ offset: ['+', 3, 0],
665
+ },
666
+ {
667
+ abbr: 'ECT',
668
+ name: 'Ecuador Time',
669
+ offset: ['-', 5, 0],
670
+ },
671
+ {
672
+ abbr: 'EDT',
673
+ name: 'Eastern Daylight Time',
674
+ offset: ['-', 4, 0],
675
+ },
676
+ {
677
+ abbr: 'EEST',
678
+ name: 'Eastern European Summer Time',
679
+ offset: ['+', 3, 0],
680
+ },
681
+ {
682
+ abbr: 'EET',
683
+ name: 'Eastern European Time',
684
+ offset: ['+', 2, 0],
685
+ },
686
+ {
687
+ abbr: 'EGST',
688
+ name: 'Eastern Greenland Summer Time',
689
+ offset: ['+', 0, 0],
690
+ },
691
+ {
692
+ abbr: 'EGT',
693
+ name: 'Eastern Greenland Time',
694
+ offset: ['-', 1, 0],
695
+ },
696
+ {
697
+ abbr: 'EIT',
698
+ name: 'Eastern Indonesian Time',
699
+ offset: ['+', 9, 0],
700
+ },
701
+ {
702
+ abbr: 'EST',
703
+ name: 'Eastern Standard Time',
704
+ offset: ['-', 5, 0],
705
+ },
706
+ {
707
+ abbr: 'ET',
708
+ name: 'Eastern Time',
709
+ offset: ['-', 5, 0],
710
+ },
711
+ {
712
+ abbr: 'FET',
713
+ name: 'Further-eastern European Time',
714
+ offset: ['+', 3, 0],
715
+ },
716
+ {
717
+ abbr: 'FJT',
718
+ name: 'Fiji Time',
719
+ offset: ['+', 12, 0],
720
+ },
721
+ {
722
+ abbr: 'FKST',
723
+ name: 'Falkland Islands Summer Time',
724
+ offset: ['-', 3, 0],
725
+ },
726
+ {
727
+ abbr: 'FKT',
728
+ name: 'Falkland Islands Time',
729
+ offset: ['-', 4, 0],
730
+ },
731
+ {
732
+ abbr: 'FNT',
733
+ name: 'Fernando de Noronha Time',
734
+ offset: ['-', 2, 0],
735
+ },
736
+ {
737
+ abbr: 'GALT',
738
+ name: 'Galapagos Time',
739
+ offset: ['-', 6, 0],
740
+ },
741
+ {
742
+ abbr: 'GAMT',
743
+ name: 'Gambier Islands',
744
+ offset: ['-', 9, 0],
745
+ },
746
+ {
747
+ abbr: 'GET',
748
+ name: 'Georgia Standard Time',
749
+ offset: ['+', 4, 0],
750
+ },
751
+ {
752
+ abbr: 'GFT',
753
+ name: 'French Guiana Time',
754
+ offset: ['-', 3, 0],
755
+ },
756
+ {
757
+ abbr: 'GILT',
758
+ name: 'Gilbert Island Time',
759
+ offset: ['+', 12, 0],
760
+ },
761
+ {
762
+ abbr: 'GIT',
763
+ name: 'Gambier Island Time',
764
+ offset: ['-', 9, 0],
765
+ },
766
+ {
767
+ abbr: 'GMT',
768
+ name: 'Greenwich Mean Time',
769
+ offset: ['+', 0, 0],
770
+ },
771
+ {
772
+ abbr: 'GST',
773
+ name: 'Gulf Standard Time',
774
+ offset: ['+', 4, 0],
775
+ },
776
+ {
777
+ abbr: 'GST',
778
+ name: 'South Georgia Time',
779
+ offset: ['-', 2, 0],
780
+ },
781
+ {
782
+ abbr: 'GYT',
783
+ name: 'Guyana Time',
784
+ offset: ['-', 4, 0],
785
+ },
786
+ {
787
+ abbr: 'HADT',
788
+ name: 'Hawaii-Aleutian Daylight Time',
789
+ offset: ['-', 9, 0],
790
+ },
791
+ {
792
+ abbr: 'HAST',
793
+ name: 'Hawaii-Aleutian Standard Time',
794
+ offset: ['-', 10, 0],
795
+ },
796
+ {
797
+ abbr: 'HKT',
798
+ name: 'Hong Kong Time',
799
+ offset: ['+', 8, 0],
800
+ },
801
+ {
802
+ abbr: 'HMT',
803
+ name: 'Heard and McDonald Islands Time',
804
+ offset: ['+', 5, 0],
805
+ },
806
+ {
807
+ abbr: 'HOVST',
808
+ name: 'Khovd Summer Time',
809
+ offset: ['+', 8, 0],
810
+ },
811
+ {
812
+ abbr: 'HOVT',
813
+ name: 'Khovd Standard Time',
814
+ offset: ['+', 7, 0],
815
+ },
816
+ {
817
+ abbr: 'ICT',
818
+ name: 'Indochina Time',
819
+ offset: ['+', 7, 0],
820
+ },
821
+ {
822
+ abbr: 'IDT',
823
+ name: 'Israel Daylight Time',
824
+ offset: ['+', 3, 0],
825
+ },
826
+ {
827
+ abbr: 'IOT',
828
+ name: 'Indian Chagos Time',
829
+ offset: ['+', 6, 0],
830
+ },
831
+ {
832
+ abbr: 'IRDT',
833
+ name: 'Iran Daylight Time',
834
+ offset: ['+', 4, 30],
835
+ },
836
+ {
837
+ abbr: 'IRKT',
838
+ name: 'Irkutsk Time',
839
+ offset: ['+', 8, 0],
840
+ },
841
+ {
842
+ abbr: 'IRST',
843
+ name: 'Iran Standard Time',
844
+ offset: ['+', 3, 30],
845
+ },
846
+ {
847
+ abbr: 'IST',
848
+ name: 'Indian Standard Time',
849
+ offset: ['+', 5, 30],
850
+ },
851
+ {
852
+ abbr: 'IST',
853
+ name: 'Irish Standard Time',
854
+ offset: ['+', 1, 0],
855
+ },
856
+ {
857
+ abbr: 'IST',
858
+ name: 'Israel Standard Time',
859
+ offset: ['+', 2, 0],
860
+ },
861
+ {
862
+ abbr: 'JST',
863
+ name: 'Japan Standard Time',
864
+ offset: ['+', 9, 0],
865
+ },
866
+ {
867
+ abbr: 'KGT',
868
+ name: 'Kyrgyzstan time',
869
+ offset: ['+', 6, 0],
870
+ },
871
+ {
872
+ abbr: 'KOST',
873
+ name: 'Kosrae Time',
874
+ offset: ['+', 11, 0],
875
+ },
876
+ {
877
+ abbr: 'KRAT',
878
+ name: 'Krasnoyarsk Time',
879
+ offset: ['+', 7, 0],
880
+ },
881
+ {
882
+ abbr: 'KST',
883
+ name: 'Korea Standard Time',
884
+ offset: ['+', 9, 0],
885
+ },
886
+ {
887
+ abbr: 'LHDT',
888
+ name: 'Lord Howe Daylight Time',
889
+ offset: ['+', 11, 0],
890
+ },
891
+ {
892
+ abbr: 'LHST',
893
+ name: 'Lord Howe Standard Time',
894
+ offset: ['+', 10, 30],
895
+ },
896
+ {
897
+ abbr: 'LINT',
898
+ name: 'Line Islands Time',
899
+ offset: ['+', 14, 0],
900
+ },
901
+ {
902
+ abbr: 'MAGT',
903
+ name: 'Magadan Time',
904
+ offset: ['+', 11, 0],
905
+ },
906
+ {
907
+ abbr: 'MART',
908
+ name: 'Marquesas Islands Time',
909
+ offset: ['-', 9, 30],
910
+ },
911
+ {
912
+ abbr: 'MAWT',
913
+ name: 'Mawson Station Time',
914
+ offset: ['+', 5, 0],
915
+ },
916
+ {
917
+ abbr: 'MDT',
918
+ name: 'Mountain Daylight Time',
919
+ offset: ['-', 6, 0],
920
+ },
921
+ {
922
+ abbr: 'MHT',
923
+ name: 'Marshall Islands',
924
+ offset: ['+', 12, 0],
925
+ },
926
+ {
927
+ abbr: 'MIST',
928
+ name: 'Macquarie Island Station Time',
929
+ offset: ['+', 11, 0],
930
+ },
931
+ {
932
+ abbr: 'MIT',
933
+ name: 'Marquesas Islands Time',
934
+ offset: ['-', 9, 30],
935
+ },
936
+ {
937
+ abbr: 'MMT',
938
+ name: 'Myanmar Standard Time',
939
+ offset: ['+', 6, 30],
940
+ },
941
+ {
942
+ abbr: 'MSK',
943
+ name: 'Moscow Time',
944
+ offset: ['+', 3, 0],
945
+ },
946
+ {
947
+ abbr: 'MST',
948
+ name: 'Mountain Standard Time',
949
+ offset: ['-', 7, 0],
950
+ },
951
+ {
952
+ abbr: 'MST',
953
+ name: 'Malaysia Standard Time',
954
+ offset: ['+', 8, 0],
955
+ },
956
+ {
957
+ abbr: 'MT',
958
+ name: 'Mountain Time',
959
+ offset: ['-', 7, 0],
960
+ },
961
+ {
962
+ abbr: 'MUT',
963
+ name: 'Mauritius Time',
964
+ offset: ['+', 4, 0],
965
+ },
966
+ {
967
+ abbr: 'MVT',
968
+ name: 'Maldives Time',
969
+ offset: ['+', 5, 0],
970
+ },
971
+ {
972
+ abbr: 'MYT',
973
+ name: 'Malaysia Time',
974
+ offset: ['+', 8, 0],
975
+ },
976
+ {
977
+ abbr: 'NCT',
978
+ name: 'New Caledonia Time',
979
+ offset: ['+', 11, 0],
980
+ },
981
+ {
982
+ abbr: 'NDT',
983
+ name: 'Newfoundland Daylight Time',
984
+ offset: ['-', 2, 30],
985
+ },
986
+ {
987
+ abbr: 'NFT',
988
+ name: 'Norfolk Time',
989
+ offset: ['+', 11, 0],
990
+ },
991
+ {
992
+ abbr: 'NPT',
993
+ name: 'Nepal Time',
994
+ offset: ['+', 5, 45],
995
+ },
996
+ {
997
+ abbr: 'NRT',
998
+ name: 'Nauru Time',
999
+ offset: ['+', 12, 0],
1000
+ },
1001
+ {
1002
+ abbr: 'NST',
1003
+ name: 'Newfoundland Standard Time',
1004
+ offset: ['-', 3, 30],
1005
+ },
1006
+ {
1007
+ abbr: 'NT',
1008
+ name: 'Newfoundland Time',
1009
+ offset: ['-', 3, 30],
1010
+ },
1011
+ {
1012
+ abbr: 'NUT',
1013
+ name: 'Niue Time',
1014
+ offset: ['-', 11, 0],
1015
+ },
1016
+ {
1017
+ abbr: 'NZDT',
1018
+ name: 'New Zealand Daylight Time',
1019
+ offset: ['+', 13, 0],
1020
+ },
1021
+ {
1022
+ abbr: 'NZST',
1023
+ name: 'New Zealand Standard Time',
1024
+ offset: ['+', 12, 0],
1025
+ },
1026
+ {
1027
+ abbr: 'OMST',
1028
+ name: 'Omsk Time',
1029
+ offset: ['+', 6, 0],
1030
+ },
1031
+ {
1032
+ abbr: 'ORAT',
1033
+ name: 'Oral Time',
1034
+ offset: ['+', 5, 0],
1035
+ },
1036
+ {
1037
+ abbr: 'PDT',
1038
+ name: 'Pacific Daylight Time',
1039
+ offset: ['-', 7, 0],
1040
+ },
1041
+ {
1042
+ abbr: 'PET',
1043
+ name: 'Peru Time',
1044
+ offset: ['-', 5, 0],
1045
+ },
1046
+ {
1047
+ abbr: 'PETT',
1048
+ name: 'Kamchatka Time',
1049
+ offset: ['+', 12, 0],
1050
+ },
1051
+ {
1052
+ abbr: 'PGT',
1053
+ name: 'Papua New Guinea Time',
1054
+ offset: ['+', 10, 0],
1055
+ },
1056
+ {
1057
+ abbr: 'PHOT',
1058
+ name: 'Phoenix Island Time',
1059
+ offset: ['+', 13, 0],
1060
+ },
1061
+ {
1062
+ abbr: 'PHST',
1063
+ name: 'Philippine Standard Time',
1064
+ offset: ['+', 8, 0],
1065
+ },
1066
+ {
1067
+ abbr: 'PHT',
1068
+ name: 'Philippine Time',
1069
+ offset: ['+', 8, 0],
1070
+ },
1071
+ {
1072
+ abbr: 'PKT',
1073
+ name: 'Pakistan Standard Time',
1074
+ offset: ['+', 5, 0],
1075
+ },
1076
+ {
1077
+ abbr: 'PMDT',
1078
+ name: 'Saint Pierre and Miquelon Daylight time',
1079
+ offset: ['-', 2, 0],
1080
+ },
1081
+ {
1082
+ abbr: 'PMST',
1083
+ name: 'Saint Pierre and Miquelon Standard Time',
1084
+ offset: ['-', 3, 0],
1085
+ },
1086
+ {
1087
+ abbr: 'PONT',
1088
+ name: 'Pohnpei Standard Time',
1089
+ offset: ['+', 11, 0],
1090
+ },
1091
+ {
1092
+ abbr: 'PST',
1093
+ name: 'Pacific Standard Time',
1094
+ offset: ['-', 8, 0],
1095
+ },
1096
+ {
1097
+ abbr: 'PT',
1098
+ name: 'Pacific Time',
1099
+ offset: ['-', 8, 0],
1100
+ },
1101
+ {
1102
+ abbr: 'PWT',
1103
+ name: 'Palau Time',
1104
+ offset: ['+', 9, 0],
1105
+ },
1106
+ {
1107
+ abbr: 'PYST',
1108
+ name: 'Paraguay Summer Time',
1109
+ offset: ['-', 3, 0],
1110
+ },
1111
+ {
1112
+ abbr: 'PYT',
1113
+ name: 'Paraguay Time',
1114
+ offset: ['-', 4, 0],
1115
+ },
1116
+ {
1117
+ abbr: 'RET',
1118
+ name: 'Réunion Time',
1119
+ offset: ['+', 4, 0],
1120
+ },
1121
+ {
1122
+ abbr: 'ROTT',
1123
+ name: 'Rothera Research Station Time',
1124
+ offset: ['-', 3, 0],
1125
+ },
1126
+ {
1127
+ abbr: 'SAKT',
1128
+ name: 'Sakhalin Island time',
1129
+ offset: ['+', 11, 0],
1130
+ },
1131
+ {
1132
+ abbr: 'SAMT',
1133
+ name: 'Samara Time',
1134
+ offset: ['+', 4, 0],
1135
+ },
1136
+ {
1137
+ abbr: 'SAST',
1138
+ name: 'South African Standard Time',
1139
+ offset: ['+', 2, 0],
1140
+ },
1141
+ {
1142
+ abbr: 'SBT',
1143
+ name: 'Solomon Islands Time',
1144
+ offset: ['+', 11, 0],
1145
+ },
1146
+ {
1147
+ abbr: 'SCT',
1148
+ name: 'Seychelles Time',
1149
+ offset: ['+', 4, 0],
1150
+ },
1151
+ {
1152
+ abbr: 'SGT',
1153
+ name: 'Singapore Time',
1154
+ offset: ['+', 8, 0],
1155
+ },
1156
+ {
1157
+ abbr: 'SLST',
1158
+ name: 'Sri Lanka Standard Time',
1159
+ offset: ['+', 5, 30],
1160
+ },
1161
+ {
1162
+ abbr: 'SRET',
1163
+ name: 'Srednekolymsk Time',
1164
+ offset: ['+', 11, 0],
1165
+ },
1166
+ {
1167
+ abbr: 'SRT',
1168
+ name: 'Suriname Time',
1169
+ offset: ['-', 3, 0],
1170
+ },
1171
+ {
1172
+ abbr: 'SST',
1173
+ name: 'Samoa Standard Time',
1174
+ offset: ['-', 11, 0],
1175
+ },
1176
+ {
1177
+ abbr: 'SYOT',
1178
+ name: 'Showa Station Time',
1179
+ offset: ['+', 3, 0],
1180
+ },
1181
+ {
1182
+ abbr: 'TAHT',
1183
+ name: 'Tahiti Time',
1184
+ offset: ['-', 10, 0],
1185
+ },
1186
+ {
1187
+ abbr: 'TFT',
1188
+ name: 'French Southern and Antarctic Time',
1189
+ offset: ['+', 5, 0],
1190
+ },
1191
+ {
1192
+ abbr: 'THA',
1193
+ name: 'Thailand Standard Time',
1194
+ offset: ['+', 7, 0],
1195
+ },
1196
+ {
1197
+ abbr: 'TJT',
1198
+ name: 'Tajikistan Time',
1199
+ offset: ['+', 5, 0],
1200
+ },
1201
+ {
1202
+ abbr: 'TKT',
1203
+ name: 'Tokelau Time',
1204
+ offset: ['+', 13, 0],
1205
+ },
1206
+ {
1207
+ abbr: 'TLT',
1208
+ name: 'Timor Leste Time',
1209
+ offset: ['+', 9, 0],
1210
+ },
1211
+ {
1212
+ abbr: 'TMT',
1213
+ name: 'Turkmenistan Time',
1214
+ offset: ['+', 5, 0],
1215
+ },
1216
+ {
1217
+ abbr: 'TOT',
1218
+ name: 'Tonga Time',
1219
+ offset: ['+', 13, 0],
1220
+ },
1221
+ {
1222
+ abbr: 'TRT',
1223
+ name: 'Turkey Time',
1224
+ offset: ['+', 3, 0],
1225
+ },
1226
+ {
1227
+ abbr: 'TVT',
1228
+ name: 'Tuvalu Time',
1229
+ offset: ['+', 12, 0],
1230
+ },
1231
+ {
1232
+ abbr: 'ULAST',
1233
+ name: 'Ulaanbaatar Summer Time',
1234
+ offset: ['+', 9, 0],
1235
+ },
1236
+ {
1237
+ abbr: 'ULAT',
1238
+ name: 'Ulaanbaatar Standard Time',
1239
+ offset: ['+', 8, 0],
1240
+ },
1241
+ {
1242
+ abbr: 'USZ1',
1243
+ name: 'Kaliningrad Time',
1244
+ offset: ['+', 2, 0],
1245
+ },
1246
+ {
1247
+ abbr: 'UTC',
1248
+ name: 'Coordinated Universal Time',
1249
+ offset: ['+', 0, 0],
1250
+ },
1251
+ {
1252
+ abbr: 'UYST',
1253
+ name: 'Uruguay Summer Time',
1254
+ offset: ['-', 2, 0],
1255
+ },
1256
+ {
1257
+ abbr: 'UYT',
1258
+ name: 'Uruguay Standard Time',
1259
+ offset: ['-', 3, 0],
1260
+ },
1261
+ {
1262
+ abbr: 'UZT',
1263
+ name: 'Uzbekistan Time',
1264
+ offset: ['+', 5, 0],
1265
+ },
1266
+ {
1267
+ abbr: 'VET',
1268
+ name: 'Venezuelan Standard Time',
1269
+ offset: ['-', 4, 0],
1270
+ },
1271
+ {
1272
+ abbr: 'VLAT',
1273
+ name: 'Vladivostok Time',
1274
+ offset: ['+', 10, 0],
1275
+ },
1276
+ {
1277
+ abbr: 'VOLT',
1278
+ name: 'Volgograd Time',
1279
+ offset: ['+', 4, 0],
1280
+ },
1281
+ {
1282
+ abbr: 'VOST',
1283
+ name: 'Vostok Station Time',
1284
+ offset: ['+', 6, 0],
1285
+ },
1286
+ {
1287
+ abbr: 'VUT',
1288
+ name: 'Vanuatu Time',
1289
+ offset: ['+', 11, 0],
1290
+ },
1291
+ {
1292
+ abbr: 'WAKT',
1293
+ name: 'Wake Island Time',
1294
+ offset: ['+', 12, 0],
1295
+ },
1296
+ {
1297
+ abbr: 'WAST',
1298
+ name: 'West Africa Summer Time',
1299
+ offset: ['+', 2, 0],
1300
+ },
1301
+ {
1302
+ abbr: 'WAT',
1303
+ name: 'West Africa Time',
1304
+ offset: ['+', 1, 0],
1305
+ },
1306
+ {
1307
+ abbr: 'WEST',
1308
+ name: 'Western European Summer Time',
1309
+ offset: ['+', 1, 0],
1310
+ },
1311
+ {
1312
+ abbr: 'WET',
1313
+ name: 'Western European Time',
1314
+ offset: ['+', 0, 0],
1315
+ },
1316
+ {
1317
+ abbr: 'WFT',
1318
+ name: 'Wallis and Futuna Time',
1319
+ offset: ['+', 12, 0],
1320
+ },
1321
+ {
1322
+ abbr: 'WGST',
1323
+ name: 'West Greenland Summer Time',
1324
+ offset: ['-', 2, 0],
1325
+ },
1326
+ {
1327
+ abbr: 'WGST',
1328
+ name: 'West Greenland Time',
1329
+ offset: ['-', 3, 0],
1330
+ },
1331
+ {
1332
+ abbr: 'WIB',
1333
+ name: 'Western Indonesia Time',
1334
+ offset: ['+', 7, 0],
1335
+ },
1336
+ {
1337
+ abbr: 'WIT',
1338
+ name: 'Eastern Indonesia Time',
1339
+ offset: ['+', 9, 0],
1340
+ },
1341
+ {
1342
+ abbr: 'WST',
1343
+ name: 'Western Standard Time',
1344
+ offset: ['+', 8, 0],
1345
+ },
1346
+ {
1347
+ abbr: 'YAKT',
1348
+ name: 'Yakutsk Time',
1349
+ offset: ['+', 9, 0],
1350
+ },
1351
+ {
1352
+ abbr: 'YEKT',
1353
+ name: 'Yekaterinburg Time',
1354
+ offset: ['+', 5, 0],
1355
+ },
1356
+ ];
355
1357
  /** The current date as a Date object */
356
1358
  const d = new Date();
357
1359
  /** The current minute of the current hour */
@@ -383,12 +1385,44 @@ const weekdayNamesList = [
383
1385
  'Friday',
384
1386
  'Saturday',
385
1387
  ];
1388
+ function compareDates(d1, mode, d2) {
1389
+ const date1 = d1.getTime(), date2 = d2.getTime();
1390
+ switch (mode) {
1391
+ case '>':
1392
+ return date1 > date2;
1393
+ case '>=':
1394
+ return date1 >= date2;
1395
+ case '<':
1396
+ return date1 < date2;
1397
+ case '<=':
1398
+ return date1 <= date2;
1399
+ case '==':
1400
+ return date1 === date2;
1401
+ default:
1402
+ throw new Error('Invalid mode');
1403
+ }
1404
+ }
386
1405
  /** The name of the current month */
387
1406
  const currentMonthName = getMonthName();
388
1407
  /** The name of the current day of the week */
389
1408
  const currentWeekdayName = getWeekdayName();
1409
+ function dateMath(d1, operator, d2) {
1410
+ const date1 = d1.getTime(), date2 = d2.getTime();
1411
+ switch (operator) {
1412
+ case '+':
1413
+ return new Date(date1 + date2);
1414
+ case '-':
1415
+ return new Date(date1 - date2);
1416
+ case '*':
1417
+ return new Date(date1 * date2);
1418
+ case '/':
1419
+ return new Date(date1 / date2);
1420
+ default:
1421
+ throw new Error('Invalid operator');
1422
+ }
1423
+ }
390
1424
  /**
391
- * ### Days In Month
1425
+ * # Days In Month
392
1426
  * - Returns the number of days in the specified month.
393
1427
  * @param {Date} date A Date object representing the month to get the number of days for. (Preset to the current date)
394
1428
  * @returns {number} The number of days in the specified month.
@@ -398,7 +1432,7 @@ function daysInMonth(date = d) {
398
1432
  return new Date(selectedYear, selectedMonth, 0).getDate();
399
1433
  }
400
1434
  /**
401
- * ### First of Month
1435
+ * # First of Month
402
1436
  * - Returns the first day of the specified month.
403
1437
  * @param {Date} date A Date object representing the month to get the first day for. (Preset to current date)
404
1438
  * @returns {Date} A Date object of the given month, with the first day.
@@ -408,7 +1442,7 @@ function firstOfMonth(date = d) {
408
1442
  return new Date(date.getFullYear(), date.getMonth(), 1);
409
1443
  }
410
1444
  /**
411
- * ### Get Date
1445
+ * # Get Date
412
1446
  * - Returns the date with two digits
413
1447
  * @param {number|Date} date The date to get date
414
1448
  * @returns {string} The date with two digits
@@ -422,7 +1456,7 @@ function getDate(date = d) {
422
1456
  return formattedDate;
423
1457
  }
424
1458
  /**
425
- * ### Get Hours
1459
+ * # Get Hours
426
1460
  * - Returns the hours with two digits
427
1461
  * @param {number|Date} hours The date to get hours
428
1462
  * @returns {string} The hours with two digits
@@ -436,7 +1470,7 @@ function getHours(hours = d) {
436
1470
  return formattedHours;
437
1471
  }
438
1472
  /**
439
- * ### Get Hours in 12
1473
+ * # Get Hours in 12
440
1474
  * - Returns the hour based on the specified 24 hour value in a 12 hour format
441
1475
  * @param {number|Date} hour The hour to be converted to 12 hour format
442
1476
  * @returns {number} The hour in a 12 hour format
@@ -449,7 +1483,7 @@ function getHoursIn12(hour = d) {
449
1483
  return hour;
450
1484
  }
451
1485
  /**
452
- * ### Get Meridian from Hour
1486
+ * # Get Meridian from Hour
453
1487
  * - Returns either 'pm' or 'am' based on the specified 24 hour value
454
1488
  * @param {number|Date} hour The hour to get the meridian from
455
1489
  * @returns {'am'|'pm'} The meridian for the given hour
@@ -462,7 +1496,7 @@ function getMeridianFromHour(hour = d) {
462
1496
  return 'am';
463
1497
  }
464
1498
  /**
465
- * ### Get Milliseconds
1499
+ * # Get Milliseconds
466
1500
  * - Returns the milliseconds with two digits
467
1501
  * @param {number|Date} milliseconds The date to get milliseconds
468
1502
  * @returns {string} The milliseconds with two digits
@@ -476,7 +1510,7 @@ function getMilliseconds(milliseconds = d) {
476
1510
  return formattedMilliseconds;
477
1511
  }
478
1512
  /**
479
- * ### Get Minutes
1513
+ * # Get Minutes
480
1514
  * - Returns the minutes with two digits
481
1515
  * @param {number|Date} minutes The date to get minutes
482
1516
  * @returns {string} The minutes with two digits
@@ -490,7 +1524,7 @@ function getMinutes(minutes = d) {
490
1524
  return formattedMinutes;
491
1525
  }
492
1526
  /**
493
- * ### Get Month
1527
+ * # Get Month
494
1528
  * - Returns the month with two digits
495
1529
  * @param {number|Date} month The date to get month
496
1530
  * @returns {string} The month with two digits
@@ -507,7 +1541,7 @@ function getMonthIndexFromName(name) {
507
1541
  return monthNamesList.findIndex(monthName => monthName === name);
508
1542
  }
509
1543
  /**
510
- * ### Get Month Name
1544
+ * # Get Month Name
511
1545
  * - Returns the name of the specified month
512
1546
  * @param {Date} date A Date object representing the month to get the name of the month from. (Preset to the current date)
513
1547
  * @returns {MonthName} The name of the specified month
@@ -518,7 +1552,7 @@ function getMonthName(date = d) {
518
1552
  return monthNamesList[date.getMonth()];
519
1553
  }
520
1554
  /**
521
- * ### Get Next Month
1555
+ * # Get Next Month
522
1556
  * - Returns the number of the following month from the specified month
523
1557
  * @param {Date} date The Date object representing the month to get the following month from (Preset to current date)
524
1558
  * @returns {number} The indexed month of the following month
@@ -529,7 +1563,7 @@ function getNextMonth(date = d) {
529
1563
  return givenMonth === 11 ? 0 : givenMonth + 1;
530
1564
  }
531
1565
  /**
532
- * ### Get Previous Month
1566
+ * # Get Previous Month
533
1567
  * - Returns the number of the previous month from the specified month
534
1568
  * @param {Date} date The Date object representing the month to get the previous month from (Preset to current date)
535
1569
  * @returns {number} The indexed month of the previous month
@@ -540,7 +1574,7 @@ function getPreviousMonth(date = d) {
540
1574
  return givenMonth === 0 ? 11 : givenMonth - 1;
541
1575
  }
542
1576
  /**
543
- * ### Get Seconds
1577
+ * # Get Seconds
544
1578
  * - Returns the seconds with two digits
545
1579
  * @param {number|Date} seconds The date to get seconds
546
1580
  * @returns {string} The seconds with two digits
@@ -554,7 +1588,16 @@ function getSeconds(seconds = d) {
554
1588
  return formattedSeconds;
555
1589
  }
556
1590
  /**
557
- * ### Get User Readable Date
1591
+ * # Get Local Timezone
1592
+ * - Returns the user's local timezone data.
1593
+ * @returns {TimezoneData | undefined} Timezone data object
1594
+ */
1595
+ function getLocalTimezone() {
1596
+ const timezoneOffset = new Date().getTimezoneOffset(), isPositive = timezoneOffset >= 0, absoluteOffset = Math.abs(timezoneOffset), offsetHours = Math.floor(absoluteOffset / 60), offsetMinutes = absoluteOffset % 60;
1597
+ return timezoneList.find(({ offset }) => (isPositive ? offset[0] === '+' : offset[0] === '-') && offset[1] === offsetHours && offset[2] === offsetMinutes);
1598
+ }
1599
+ /**
1600
+ * # Get User Readable Date
558
1601
  * - Returns a string of the current date in a user-friendly way
559
1602
  * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`
560
1603
  * @param date (default: `new Date()`)
@@ -579,7 +1622,7 @@ function getUserReadableDate(date = d) {
579
1622
  return fullDateString;
580
1623
  }
581
1624
  /**
582
- * ### Get Weekday Name
1625
+ * # Get Weekday Name
583
1626
  * - Returns the weekday name of the specified day
584
1627
  * @param {number | Date} weekday A Date object or number representing the day to get the weekday name from. (Preset to the current date)
585
1628
  * @returns {WeekdayName} The name of the specified weekday
@@ -591,7 +1634,7 @@ function getWeekdayName(weekday = d) {
591
1634
  return weekdayNamesList[weekday.getDay()];
592
1635
  }
593
1636
  /**
594
- * ### Get Years in Range
1637
+ * # Get Years in Range
595
1638
  * - Returns an array of years in between the specified minimum and maximum years
596
1639
  * @param {number} minYear The minimum year
597
1640
  * @param {number} maxYear The maximum year
@@ -605,7 +1648,7 @@ function getYearsInRange(minYear = 0, maxYear = year) {
605
1648
  return yearList;
606
1649
  }
607
1650
  /**
608
- * ### To Full Date String
1651
+ * # To Full Date String
609
1652
  * - Returns a formatted string to display the date
610
1653
  * @param {Date} date (default: `new Date()`)
611
1654
  * @param {ToFullDateStringOptionsProps} options Change how to display the weekday, month name, day of the month, and year.
@@ -648,7 +1691,7 @@ function toFullDateString(date = d, options) {
648
1691
  return weekdayName + monthName + dayOfMonth + year;
649
1692
  }
650
1693
  /**
651
- * ### Get User Readable Date From Timestampz
1694
+ * # Get User Readable Date From Timestampz
652
1695
  * - Returns a string of the current date in a user-friendly way
653
1696
  * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`
654
1697
  * @param string
@@ -658,31 +1701,12 @@ function getUserReadableDateFromTimestampz(timestampz) {
658
1701
  const [date, time] = timestampz.split('T') || [];
659
1702
  const [year, month, day] = date?.split('-').map(string => Number(string)) || [];
660
1703
  const timezoneIsAheadOfUTC = time?.includes('+');
661
- const [hms, timezone] = timezoneIsAheadOfUTC ? time?.split('+') : time?.split('-') || [];
1704
+ const [hms, _timezone] = timezoneIsAheadOfUTC ? time?.split('+') : time?.split('-') || [];
662
1705
  const [hours, minutes, seconds] = hms?.split(':').map(string => Number(string)) || [];
663
- const [timezoneHours, timezoneMinutes] = timezone?.split(':').map(string => Number(string)) || [];
1706
+ // const [timezoneHours, timezoneMinutes] = timezone?.split(':').map(string => Number(string)) || []
664
1707
  const dateAndTime = new Date(year, month - 1, day, hours, minutes, seconds), userReadableDateAndTime = getUserReadableDate(dateAndTime);
665
1708
  return userReadableDateAndTime;
666
1709
  }
667
- function getLocalTime(time) {
668
- const date = new Date(), [hours, minutes] = typeof time === 'string' ? time.split(':') : time;
669
- const timezone = getTimezone();
670
- console.log(timezone);
671
- date.setUTCHours(Number(hours));
672
- date.setMinutes(Number(minutes));
673
- return date.toLocaleTimeString([], {
674
- hour: 'numeric',
675
- minute: '2-digit',
676
- hour12: true,
677
- });
678
- }
679
- function getTimezone() {
680
- const date = new Date();
681
- const timezonePart = Intl.DateTimeFormat('en-US', { timeZoneName: 'short' })
682
- .formatToParts(date)
683
- .find(part => part.type === 'timeZoneName');
684
- return timezonePart ? timezonePart.value : '';
685
- }
686
1710
 
687
1711
  function findComponentByType(children, componentType) {
688
1712
  const childrenArray = react.Children.toArray(children);
@@ -767,13 +1791,14 @@ function isPhoneNumber(tel) {
767
1791
  * @returns {string} string formatted
768
1792
  */
769
1793
  function formatPhoneNumber(phoneNumber, options) {
770
- const format = options?.format || 'standard';
771
- if (format !== 'none')
772
- phoneNumber = phoneNumber.replace(/\D/g, '').slice(-10);
1794
+ const format = options?.format || "standard";
1795
+ if (format !== "none") {
1796
+ phoneNumber = phoneNumber.replace(/\D/g, "").slice(-10);
1797
+ }
773
1798
  switch (format) {
774
- case 'dot':
1799
+ case "dot":
775
1800
  phoneNumber = phoneNumber
776
- .split('')
1801
+ .split("")
777
1802
  .map((char, index) => {
778
1803
  if (index === 2)
779
1804
  return `${char}.`;
@@ -781,11 +1806,11 @@ function formatPhoneNumber(phoneNumber, options) {
781
1806
  return `${char}.`;
782
1807
  return char;
783
1808
  })
784
- .join('');
1809
+ .join("");
785
1810
  break;
786
- case 'hyphenated':
1811
+ case "hyphenated":
787
1812
  phoneNumber = phoneNumber
788
- .split('')
1813
+ .split("")
789
1814
  .map((char, index) => {
790
1815
  if (index === 2)
791
1816
  return `${char}-`;
@@ -793,11 +1818,11 @@ function formatPhoneNumber(phoneNumber, options) {
793
1818
  return `${char}-`;
794
1819
  return char;
795
1820
  })
796
- .join('');
1821
+ .join("");
797
1822
  break;
798
- case 'space':
1823
+ case "space":
799
1824
  phoneNumber = phoneNumber
800
- .split('')
1825
+ .split("")
801
1826
  .map((char, index) => {
802
1827
  if (index === 2)
803
1828
  return `${char} `;
@@ -805,11 +1830,11 @@ function formatPhoneNumber(phoneNumber, options) {
805
1830
  return `${char} `;
806
1831
  return char;
807
1832
  })
808
- .join('');
1833
+ .join("");
809
1834
  break;
810
- case 'standard':
1835
+ case "standard":
811
1836
  phoneNumber = phoneNumber
812
- .split('')
1837
+ .split("")
813
1838
  .map((char, index) => {
814
1839
  if (index === 0)
815
1840
  return `(${char}`;
@@ -819,9 +1844,50 @@ function formatPhoneNumber(phoneNumber, options) {
819
1844
  return `${char}-`;
820
1845
  return char;
821
1846
  })
822
- .join('');
1847
+ .join("");
823
1848
  }
824
- return `${options?.countryCode ? `+${options?.countryCode} ` : ''}` + phoneNumber;
1849
+ return `${options?.countryCode ? `+${options?.countryCode} ` : ""}` +
1850
+ phoneNumber;
1851
+ }
1852
+ /**
1853
+ * ### Split Camel Case
1854
+ * - Separates a camel case string with a joiner (default: ' ')
1855
+ * @param {string} string
1856
+ * @returns {string} string
1857
+ */
1858
+ function splitCamelCase(string, joiner = " ") {
1859
+ if (string[0].match(/[A-Z0-9]/) || string.includes(" "))
1860
+ return string;
1861
+ let lastChar = "";
1862
+ return string.split("")
1863
+ .map((char) => {
1864
+ let returnedString = char;
1865
+ if (char.match(/[A-Z0-9]/))
1866
+ returnedString = ` ${char}`;
1867
+ if (lastChar.match(/[0-9]/) && char.match(/[0-9]/))
1868
+ returnedString = char;
1869
+ lastChar = char;
1870
+ return returnedString;
1871
+ })
1872
+ .join(joiner);
1873
+ }
1874
+ /**
1875
+ * ### To Camel Case
1876
+ * - Converts any string to camel case based on spaces
1877
+ * - Eliminates no letter-number characters
1878
+ * @param {string} string
1879
+ * @returns {string} string
1880
+ */
1881
+ function toCamelCase(string, delimiter = " ") {
1882
+ if (typeof string !== "string")
1883
+ return string;
1884
+ return string
1885
+ .toLowerCase()
1886
+ .replace(/[^a-z0-9]/gi, delimiter)
1887
+ .split(delimiter)
1888
+ .map((str, index) => index === 0 ? str : str.substring(0, 1).toUpperCase() +
1889
+ str.substring(1, str.length).toLowerCase())
1890
+ .join("");
825
1891
  }
826
1892
  /**
827
1893
  * # To Lower Case
@@ -833,7 +1899,23 @@ function formatPhoneNumber(phoneNumber, options) {
833
1899
  * @returns The lowercase version of the input string, with the replacements, if provided.
834
1900
  */
835
1901
  function toLowerCase(str, [delimiter, joiner]) {
836
- return str.toLowerCase().replaceAll(delimiter || ' ', joiner || ' ');
1902
+ return str.toLowerCase().replaceAll(delimiter || " ", joiner || " ");
1903
+ }
1904
+ /**
1905
+ * ### To Title Case
1906
+ * - Converts any string to title case based on spaces
1907
+ * @param {string} string
1908
+ * @returns {string} string
1909
+ */
1910
+ function toTitleCase(string, delimiter = " ") {
1911
+ if (typeof string !== "string")
1912
+ return string;
1913
+ return string
1914
+ .toLowerCase()
1915
+ .split(delimiter)
1916
+ .map((str) => str.substring(0, 1).toUpperCase() +
1917
+ str.substring(1, str.length).toLowerCase())
1918
+ .join(" ");
837
1919
  }
838
1920
 
839
1921
  function twSort(className) {
@@ -841,8 +1923,10 @@ function twSort(className) {
841
1923
  }
842
1924
 
843
1925
  exports.addClass = addClass;
1926
+ exports.compareDates = compareDates;
844
1927
  exports.currentMonthName = currentMonthName;
845
1928
  exports.currentWeekdayName = currentWeekdayName;
1929
+ exports.dateMath = dateMath;
846
1930
  exports.daysInMonth = daysInMonth;
847
1931
  exports.easeOutExpo = easeOutExpo;
848
1932
  exports.emailRegex = emailRegex;
@@ -853,7 +1937,7 @@ exports.formatPhoneNumber = formatPhoneNumber;
853
1937
  exports.getDate = getDate;
854
1938
  exports.getHours = getHours;
855
1939
  exports.getHoursIn12 = getHoursIn12;
856
- exports.getLocalTime = getLocalTime;
1940
+ exports.getLocalTimezone = getLocalTimezone;
857
1941
  exports.getMeridianFromHour = getMeridianFromHour;
858
1942
  exports.getMilliseconds = getMilliseconds;
859
1943
  exports.getMinutes = getMinutes;
@@ -863,7 +1947,6 @@ exports.getMonthName = getMonthName;
863
1947
  exports.getNextMonth = getNextMonth;
864
1948
  exports.getPreviousMonth = getPreviousMonth;
865
1949
  exports.getSeconds = getSeconds;
866
- exports.getTimezone = getTimezone;
867
1950
  exports.getUserReadableDate = getUserReadableDate;
868
1951
  exports.getUserReadableDateFromTimestampz = getUserReadableDateFromTimestampz;
869
1952
  exports.getWeekdayName = getWeekdayName;
@@ -873,9 +1956,13 @@ exports.isEmail = isEmail;
873
1956
  exports.isPhoneNumber = isPhoneNumber;
874
1957
  exports.monthNamesList = monthNamesList;
875
1958
  exports.removeClass = removeClass;
1959
+ exports.splitCamelCase = splitCamelCase;
876
1960
  exports.telRegex = telRegex;
1961
+ exports.timezoneList = timezoneList;
1962
+ exports.toCamelCase = toCamelCase;
877
1963
  exports.toFullDateString = toFullDateString;
878
1964
  exports.toLowerCase = toLowerCase;
1965
+ exports.toTitleCase = toTitleCase;
879
1966
  exports.toggleClass = toggleClass;
880
1967
  exports.twMerge = twMerge;
881
1968
  exports.twSort = twSort;