@burdenoff/microfe-crewfoundry 2026.1013.1 → 2026.1029.1

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 (214) hide show
  1. package/dist/crewfoundry/CrewFoundryRoot.d.ts.map +1 -1
  2. package/dist/crewfoundry/CrewFoundryRoot.js +160 -256
  3. package/dist/crewfoundry/CrewFoundryRoot.js.map +1 -1
  4. package/dist/crewfoundry/CrewFoundryRoutes.d.ts.map +1 -1
  5. package/dist/crewfoundry/CrewFoundryRoutes.js +152 -192
  6. package/dist/crewfoundry/CrewFoundryRoutes.js.map +1 -1
  7. package/dist/crewfoundry/components/InlineError.d.ts +5 -0
  8. package/dist/crewfoundry/components/InlineError.d.ts.map +1 -0
  9. package/dist/crewfoundry/components/InlineError.js +17 -0
  10. package/dist/crewfoundry/components/InlineError.js.map +1 -0
  11. package/dist/crewfoundry/components/forms/FormModal.d.ts +25 -1
  12. package/dist/crewfoundry/components/forms/FormModal.d.ts.map +1 -1
  13. package/dist/crewfoundry/components/forms/FormModal.js +151 -136
  14. package/dist/crewfoundry/components/forms/FormModal.js.map +1 -1
  15. package/dist/crewfoundry/components/marketplace/BookServiceModal.d.ts +14 -0
  16. package/dist/crewfoundry/components/marketplace/BookServiceModal.d.ts.map +1 -0
  17. package/dist/crewfoundry/components/marketplace/BookServiceModal.js +75 -0
  18. package/dist/crewfoundry/components/marketplace/BookServiceModal.js.map +1 -0
  19. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.d.ts +24 -0
  20. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.d.ts.map +1 -0
  21. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.js +47 -0
  22. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.js.map +1 -0
  23. package/dist/crewfoundry/components/marketplace/ServiceListingModal.d.ts +12 -0
  24. package/dist/crewfoundry/components/marketplace/ServiceListingModal.d.ts.map +1 -0
  25. package/dist/crewfoundry/components/marketplace/ServiceListingModal.js +123 -0
  26. package/dist/crewfoundry/components/marketplace/ServiceListingModal.js.map +1 -0
  27. package/dist/crewfoundry/components/viz/CertificateCard.js +4 -118
  28. package/dist/crewfoundry/components/viz/PathSteps.js +3 -68
  29. package/dist/crewfoundry/components/viz/lib/geometry.js +5 -13
  30. package/dist/crewfoundry/components/viz/lib/geometry.js.map +1 -1
  31. package/dist/crewfoundry/lib/analytics.d.ts +1 -6
  32. package/dist/crewfoundry/lib/analytics.d.ts.map +1 -1
  33. package/dist/crewfoundry/lib/analytics.js +3 -18
  34. package/dist/crewfoundry/lib/analytics.js.map +1 -1
  35. package/dist/crewfoundry/lib/companyFinance.d.ts +3 -7
  36. package/dist/crewfoundry/lib/companyFinance.d.ts.map +1 -1
  37. package/dist/crewfoundry/lib/companyFinance.js +3 -8
  38. package/dist/crewfoundry/lib/companyFinance.js.map +1 -1
  39. package/dist/crewfoundry/lib/learning.d.ts +12 -0
  40. package/dist/crewfoundry/lib/learning.d.ts.map +1 -0
  41. package/dist/crewfoundry/lib/learning.js +26 -0
  42. package/dist/crewfoundry/lib/learning.js.map +1 -0
  43. package/dist/crewfoundry/lib/marketplace.d.ts +30 -0
  44. package/dist/crewfoundry/lib/marketplace.d.ts.map +1 -0
  45. package/dist/crewfoundry/lib/marketplace.js +91 -0
  46. package/dist/crewfoundry/lib/marketplace.js.map +1 -0
  47. package/dist/crewfoundry/lib/useEnsureLoaded.d.ts +7 -0
  48. package/dist/crewfoundry/lib/useEnsureLoaded.d.ts.map +1 -0
  49. package/dist/crewfoundry/lib/useEnsureLoaded.js +25 -0
  50. package/dist/crewfoundry/lib/useEnsureLoaded.js.map +1 -0
  51. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.d.ts.map +1 -1
  52. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js +12 -25
  53. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js.map +1 -1
  54. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.d.ts.map +1 -1
  55. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js +49 -49
  56. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js.map +1 -1
  57. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.d.ts.map +1 -1
  58. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js +145 -157
  59. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js.map +1 -1
  60. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.d.ts.map +1 -1
  61. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js +14 -14
  62. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js.map +1 -1
  63. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.d.ts.map +1 -1
  64. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js +14 -14
  65. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js.map +1 -1
  66. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.d.ts.map +1 -1
  67. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.js +71 -33
  68. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.js.map +1 -1
  69. package/dist/crewfoundry/pages/HiringCreateJobPagePage.d.ts.map +1 -1
  70. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js +260 -115
  71. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js.map +1 -1
  72. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.d.ts.map +1 -1
  73. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js +199 -166
  74. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js.map +1 -1
  75. package/dist/crewfoundry/pages/HiringJobsPagePage.d.ts.map +1 -1
  76. package/dist/crewfoundry/pages/HiringJobsPagePage.js +118 -104
  77. package/dist/crewfoundry/pages/HiringJobsPagePage.js.map +1 -1
  78. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.d.ts.map +1 -1
  79. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js +247 -173
  80. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js.map +1 -1
  81. package/dist/crewfoundry/pages/LearningCoursesPagePage.d.ts +12 -0
  82. package/dist/crewfoundry/pages/LearningCoursesPagePage.d.ts.map +1 -1
  83. package/dist/crewfoundry/pages/LearningCoursesPagePage.js +307 -293
  84. package/dist/crewfoundry/pages/LearningCoursesPagePage.js.map +1 -1
  85. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.d.ts +2 -0
  86. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.d.ts.map +1 -0
  87. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.js +223 -0
  88. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.js.map +1 -0
  89. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.d.ts +4 -0
  90. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.d.ts.map +1 -1
  91. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.js +115 -160
  92. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.js.map +1 -1
  93. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.d.ts.map +1 -1
  94. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.js +165 -75
  95. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.js.map +1 -1
  96. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.d.ts +7 -0
  97. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.d.ts.map +1 -0
  98. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.js +175 -0
  99. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.js.map +1 -0
  100. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.d.ts.map +1 -1
  101. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js +182 -223
  102. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js.map +1 -1
  103. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.d.ts.map +1 -1
  104. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js +168 -227
  105. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js.map +1 -1
  106. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.d.ts.map +1 -1
  107. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js +127 -290
  108. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js.map +1 -1
  109. package/dist/crewfoundry/store/crewfoundryStore.d.ts +139 -79
  110. package/dist/crewfoundry/store/crewfoundryStore.d.ts.map +1 -1
  111. package/dist/crewfoundry/store/crewfoundryStore.js +323 -244
  112. package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
  113. package/dist/crewfoundry/utils/dateUtils.d.ts +52 -0
  114. package/dist/crewfoundry/utils/dateUtils.d.ts.map +1 -0
  115. package/dist/crewfoundry/utils/dateUtils.js +31 -0
  116. package/dist/crewfoundry/utils/dateUtils.js.map +1 -0
  117. package/dist/generated/global-types.d.ts +5145 -1627
  118. package/dist/generated/global-types.d.ts.map +1 -1
  119. package/dist/generated/wspace-types.d.ts +100373 -34602
  120. package/dist/generated/wspace-types.d.ts.map +1 -1
  121. package/dist/utils/pageContext.d.ts.map +1 -1
  122. package/dist/utils/pageContext.js +0 -1
  123. package/dist/utils/pageContext.js.map +1 -1
  124. package/package.json +1 -1
  125. package/dist/crewfoundry/components/viz/CertificateCard.js.map +0 -1
  126. package/dist/crewfoundry/components/viz/PathSteps.js.map +0 -1
  127. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.d.ts +0 -2
  128. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.d.ts.map +0 -1
  129. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.js +0 -53
  130. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.js.map +0 -1
  131. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.d.ts +0 -2
  132. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.d.ts.map +0 -1
  133. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js +0 -107
  134. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js.map +0 -1
  135. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.d.ts +0 -2
  136. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.d.ts.map +0 -1
  137. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.js +0 -62
  138. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.js.map +0 -1
  139. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.d.ts +0 -2
  140. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.d.ts.map +0 -1
  141. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js +0 -37
  142. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js.map +0 -1
  143. package/dist/crewfoundry/pages/LearningCertificatesPagePage.d.ts +0 -2
  144. package/dist/crewfoundry/pages/LearningCertificatesPagePage.d.ts.map +0 -1
  145. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js +0 -111
  146. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js.map +0 -1
  147. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.d.ts +0 -2
  148. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.d.ts.map +0 -1
  149. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js +0 -309
  150. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js.map +0 -1
  151. package/dist/crewfoundry/pages/LearningLearningPagePage.d.ts +0 -2
  152. package/dist/crewfoundry/pages/LearningLearningPagePage.d.ts.map +0 -1
  153. package/dist/crewfoundry/pages/LearningLearningPagePage.js +0 -200
  154. package/dist/crewfoundry/pages/LearningLearningPagePage.js.map +0 -1
  155. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.d.ts +0 -2
  156. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.d.ts.map +0 -1
  157. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js +0 -190
  158. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js.map +0 -1
  159. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.d.ts +0 -2
  160. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.d.ts.map +0 -1
  161. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js +0 -230
  162. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js.map +0 -1
  163. package/dist/crewfoundry/pages/LearningMyLearningPagePage.d.ts +0 -2
  164. package/dist/crewfoundry/pages/LearningMyLearningPagePage.d.ts.map +0 -1
  165. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js +0 -293
  166. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js.map +0 -1
  167. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.d.ts +0 -2
  168. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.d.ts.map +0 -1
  169. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.js +0 -163
  170. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.js.map +0 -1
  171. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.d.ts +0 -2
  172. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.d.ts.map +0 -1
  173. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js +0 -365
  174. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js.map +0 -1
  175. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.d.ts +0 -2
  176. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.d.ts.map +0 -1
  177. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js +0 -224
  178. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js.map +0 -1
  179. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.d.ts +0 -2
  180. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.d.ts.map +0 -1
  181. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js +0 -180
  182. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js.map +0 -1
  183. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.d.ts +0 -2
  184. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.d.ts.map +0 -1
  185. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.js +0 -38
  186. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.js.map +0 -1
  187. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.d.ts +0 -2
  188. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.d.ts.map +0 -1
  189. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js +0 -204
  190. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js.map +0 -1
  191. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.d.ts +0 -2
  192. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.d.ts.map +0 -1
  193. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.js +0 -55
  194. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.js.map +0 -1
  195. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.d.ts +0 -2
  196. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.d.ts.map +0 -1
  197. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js +0 -335
  198. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js.map +0 -1
  199. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.d.ts +0 -2
  200. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.d.ts.map +0 -1
  201. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js +0 -160
  202. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js.map +0 -1
  203. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.d.ts +0 -2
  204. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.d.ts.map +0 -1
  205. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.js +0 -80
  206. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.js.map +0 -1
  207. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.d.ts +0 -2
  208. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.d.ts.map +0 -1
  209. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.js +0 -191
  210. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.js.map +0 -1
  211. package/dist/crewfoundry/utils/courseProgress.d.ts +0 -33
  212. package/dist/crewfoundry/utils/courseProgress.d.ts.map +0 -1
  213. package/dist/crewfoundry/utils/courseProgress.js +0 -46
  214. package/dist/crewfoundry/utils/courseProgress.js.map +0 -1
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Local-calendar date utilities for the CrewFoundry MFE.
3
+ *
4
+ * The native `new Date('YYYY-MM-DD')` constructor parses date-only strings
5
+ * as UTC midnight, which silently breaks user-facing date math for callers
6
+ * in non-UTC timezones (a deadline picked as "today" in PST is already
7
+ * 17-20 hours in the past by local noon). These helpers parse and compare
8
+ * as local-calendar-day values instead.
9
+ */
10
+ /**
11
+ * Parse a YYYY-MM-DD or ISO-8601 timestamp as local-midnight on that
12
+ * calendar day. Two input shapes are accepted because the same field
13
+ * can arrive either way depending on the source:
14
+ *
15
+ * - 'YYYY-MM-DD' — what the date input sends on save (local calendar day).
16
+ * - 'YYYY-MM-DDTHH:mm:ss.sssZ' (or with an offset) — what the GraphQL
17
+ * server returns for `DateTime` columns (UTC instant).
18
+ *
19
+ * For full timestamps we extract the date portion BEFORE constructing the
20
+ * Date, so a UTC midnight instant displays as the same calendar day in
21
+ * any timezone (a deadline stored as 2026-09-29T00:00:00Z is meant to be
22
+ * 2026-09-29, not whatever the user's timezone shifts it to).
23
+ *
24
+ * Returns null if the input isn't a well-formed date-only or ISO string,
25
+ * an unparseable Date, an out-of-range date component (e.g. 2026-02-30),
26
+ * or an empty value. Callers that want a raw Date back should check the
27
+ * result.
28
+ */
29
+ export declare function parseLocalDate(dateStr: string | null | undefined): Date | null;
30
+ /**
31
+ * Whole-day difference between two dates, compared as local calendar days.
32
+ *
33
+ * Both inputs are interpreted at their local midnight. The result is the
34
+ * signed integer count of calendar days from `from` to `to` (negative if
35
+ * `to` is earlier). The inputs must already be valid Dates — this helper
36
+ * does no validity checking; call parseLocalDate first for YYYY-MM-DD
37
+ * strings.
38
+ */
39
+ export declare function localDayDiff(from: Date, to: Date): number;
40
+ /**
41
+ * Local-calendar today as a YYYY-MM-DD string. Recomputed on every call;
42
+ * callers that need the picker `min` value pass this through a prop and
43
+ * accept that the prop won't refresh across midnight without a re-render
44
+ * trigger (typing in the form is sufficient in practice).
45
+ */
46
+ export declare function localTodayString(): string;
47
+ /**
48
+ * Format an ISO timestamp (or YYYY-MM-DD) as a short local date, e.g.
49
+ * "Oct 29, 2026". Returns an em dash for empty or unparseable input.
50
+ */
51
+ export declare function formatDate(value: string | null | undefined): string;
52
+ //# sourceMappingURL=dateUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../src/crewfoundry/utils/dateUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAe9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKnE"}
@@ -0,0 +1,31 @@
1
+ //#region src/crewfoundry/utils/dateUtils.ts
2
+ function e(e) {
3
+ if (!e) return null;
4
+ let t = /^\d{4}-\d{2}-\d{2}/.exec(e);
5
+ if (!t) return null;
6
+ let [n, r, i] = t[0].split("-").map((e) => Number(e));
7
+ if (!Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i)) return null;
8
+ let a = new Date(n, r - 1, i);
9
+ return a.getFullYear() !== n || a.getMonth() !== r - 1 || a.getDate() !== i ? null : a;
10
+ }
11
+ function t(e, t) {
12
+ let n = new Date(e.getFullYear(), e.getMonth(), e.getDate()), r = new Date(t.getFullYear(), t.getMonth(), t.getDate());
13
+ return Math.round((r.getTime() - n.getTime()) / 864e5);
14
+ }
15
+ function n() {
16
+ let e = /* @__PURE__ */ new Date();
17
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
18
+ }
19
+ function r(e) {
20
+ if (!e) return "—";
21
+ let t = new Date(e);
22
+ return Number.isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
23
+ month: "short",
24
+ day: "numeric",
25
+ year: "numeric"
26
+ });
27
+ }
28
+ //#endregion
29
+ export { r as formatDate, t as localDayDiff, n as localTodayString, e as parseLocalDate };
30
+
31
+ //# sourceMappingURL=dateUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateUtils.js","names":[],"sources":["../../../src/crewfoundry/utils/dateUtils.ts"],"sourcesContent":["/**\n * Local-calendar date utilities for the CrewFoundry MFE.\n *\n * The native `new Date('YYYY-MM-DD')` constructor parses date-only strings\n * as UTC midnight, which silently breaks user-facing date math for callers\n * in non-UTC timezones (a deadline picked as \"today\" in PST is already\n * 17-20 hours in the past by local noon). These helpers parse and compare\n * as local-calendar-day values instead.\n */\n\n/**\n * Parse a YYYY-MM-DD or ISO-8601 timestamp as local-midnight on that\n * calendar day. Two input shapes are accepted because the same field\n * can arrive either way depending on the source:\n *\n * - 'YYYY-MM-DD' — what the date input sends on save (local calendar day).\n * - 'YYYY-MM-DDTHH:mm:ss.sssZ' (or with an offset) — what the GraphQL\n * server returns for `DateTime` columns (UTC instant).\n *\n * For full timestamps we extract the date portion BEFORE constructing the\n * Date, so a UTC midnight instant displays as the same calendar day in\n * any timezone (a deadline stored as 2026-09-29T00:00:00Z is meant to be\n * 2026-09-29, not whatever the user's timezone shifts it to).\n *\n * Returns null if the input isn't a well-formed date-only or ISO string,\n * an unparseable Date, an out-of-range date component (e.g. 2026-02-30),\n * or an empty value. Callers that want a raw Date back should check the\n * result.\n */\nexport function parseLocalDate(dateStr: string | null | undefined): Date | null {\n if (!dateStr) return null;\n // Extract the YYYY-MM-DD prefix: handles both date-only inputs and\n // full ISO timestamps (YYYY-MM-DDTHH:mm:ss...).\n const dateOnlyMatch = /^\\d{4}-\\d{2}-\\d{2}/.exec(dateStr);\n if (!dateOnlyMatch) return null;\n const [year, month, day] = dateOnlyMatch[0].split('-').map((part) => Number(part));\n if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) {\n return null;\n }\n const date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n return date;\n}\n\n/**\n * Whole-day difference between two dates, compared as local calendar days.\n *\n * Both inputs are interpreted at their local midnight. The result is the\n * signed integer count of calendar days from `from` to `to` (negative if\n * `to` is earlier). The inputs must already be valid Dates — this helper\n * does no validity checking; call parseLocalDate first for YYYY-MM-DD\n * strings.\n */\nexport function localDayDiff(from: Date, to: Date): number {\n const fromMidnight = new Date(from.getFullYear(), from.getMonth(), from.getDate());\n const toMidnight = new Date(to.getFullYear(), to.getMonth(), to.getDate());\n return Math.round((toMidnight.getTime() - fromMidnight.getTime()) / 86_400_000);\n}\n\n/**\n * Local-calendar today as a YYYY-MM-DD string. Recomputed on every call;\n * callers that need the picker `min` value pass this through a prop and\n * accept that the prop won't refresh across midnight without a re-render\n * trigger (typing in the form is sufficient in practice).\n */\nexport function localTodayString(): string {\n const now = new Date();\n return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;\n}\n\n/**\n * Format an ISO timestamp (or YYYY-MM-DD) as a short local date, e.g.\n * \"Oct 29, 2026\". Returns an em dash for empty or unparseable input.\n */\nexport function formatDate(value: string | null | undefined): string {\n if (!value) return '—';\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return '—';\n return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });\n}\n"],"mappings":";AA6BA,SAAgB,EAAe,GAAiD;AAC9E,KAAI,CAAC,EAAS,QAAO;CAGrB,IAAM,IAAgB,qBAAqB,KAAK,EAAQ;AACxD,KAAI,CAAC,EAAe,QAAO;CAC3B,IAAM,CAAC,GAAM,GAAO,KAAO,EAAc,GAAG,MAAM,IAAI,CAAC,KAAK,MAAS,OAAO,EAAK,CAAC;AAClF,KAAI,CAAC,OAAO,SAAS,EAAK,IAAI,CAAC,OAAO,SAAS,EAAM,IAAI,CAAC,OAAO,SAAS,EAAI,CAC5E,QAAO;CAET,IAAM,IAAO,IAAI,KAAK,GAAM,IAAQ,GAAG,EAAI;AAI3C,QAHI,EAAK,aAAa,KAAK,KAAQ,EAAK,UAAU,KAAK,IAAQ,KAAK,EAAK,SAAS,KAAK,IAC9E,OAEF;;AAYT,SAAgB,EAAa,GAAY,GAAkB;CACzD,IAAM,IAAe,IAAI,KAAK,EAAK,aAAa,EAAE,EAAK,UAAU,EAAE,EAAK,SAAS,CAAC,EAC5E,IAAa,IAAI,KAAK,EAAG,aAAa,EAAE,EAAG,UAAU,EAAE,EAAG,SAAS,CAAC;AAC1E,QAAO,KAAK,OAAO,EAAW,SAAS,GAAG,EAAa,SAAS,IAAI,MAAW;;AASjF,SAAgB,IAA2B;CACzC,IAAM,oBAAM,IAAI,MAAM;AACtB,QAAO,GAAG,EAAI,aAAa,CAAC,GAAG,OAAO,EAAI,UAAU,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,OAAO,EAAI,SAAS,CAAC,CAAC,SAAS,GAAG,IAAI;;AAOtH,SAAgB,EAAW,GAA0C;AACnE,KAAI,CAAC,EAAO,QAAO;CACnB,IAAM,IAAO,IAAI,KAAK,EAAM;AAE5B,QADI,OAAO,MAAM,EAAK,SAAS,CAAC,GAAS,MAClC,EAAK,mBAAmB,KAAA,GAAW;EAAE,OAAO;EAAS,KAAK;EAAW,MAAM;EAAW,CAAC"}