@licklist/design 0.44.520 → 0.44.522

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.
@@ -1 +1 @@
1
- {"version":3,"file":"WorkingHoursInputDescription.d.ts","sourceRoot":"","sources":["../../../src/provider/working-hours-input/WorkingHoursInputDescription.tsx"],"names":[],"mappings":";AASA,wBAAgB,4BAA4B,gBAsC3C"}
1
+ {"version":3,"file":"WorkingHoursInputDescription.d.ts","sourceRoot":"","sources":["../../../src/provider/working-hours-input/WorkingHoursInputDescription.tsx"],"names":[],"mappings":";AASA,wBAAgB,4BAA4B,gBAqC3C"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),o=require("react-bootstrap"),a=require("react-hook-form"),u=require("luxon"),i=require("react-intl"),l=require("./utils.js");exports.WorkingHoursInputDescription=function(){var e=(0,a.useFormContext().watch)("workingHours"),t=l.useWeekdays("short"),s=n.useTranslation("Design").t,m=i.useIntl().formatTime;return r.createElement(r.Fragment,null,Array.from({length:t.length},(function(e,t){return t})).filter((function(t){var r;return null===(r=null==e?void 0:e[t])||void 0===r?void 0:r.start})).map((function(n){var a=null==e?void 0:e[n];return r.createElement(o.Row,{key:n},r.createElement(o.Col,{xs:"auto"},t[n],":"),r.createElement(o.Col,null,(null==a?void 0:a.end)?a.start?s("timeInterval",{start:m(u.DateTime.fromISO(a.start).toJSDate()),end:m(u.DateTime.fromISO(a.end).toJSDate())}):s("timeFrom",{start:m(u.DateTime.fromISO(a.start).toJSDate())}):null))})))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,o=require("@licklist/core/dist/Config"),n=require("react-i18next"),a=require("react-bootstrap"),i=require("react-hook-form"),u=require("luxon"),l=require("./utils.js");exports.WorkingHoursInputDescription=function(){var e=(0,i.useFormContext().watch)("workingHours"),t=l.useWeekdays("short"),s=n.useTranslation("Design").t;return e?r.createElement(r.Fragment,null,Array.from({length:t.length},(function(e,t){return t})).filter((function(t){var r;return null===(r=null==e?void 0:e[t])||void 0===r?void 0:r.start})).map((function(n){var i=null==e?void 0:e[n];return r.createElement(a.Row,{key:n},r.createElement(a.Col,{xs:"auto"},t[n],":"),r.createElement(a.Col,null,(null==i?void 0:i.end)?i.start?s("timeInterval",{start:u.DateTime.fromISO(i.start).toFormat(o.TIME_FORMAT),end:u.DateTime.fromISO(i.start).toFormat(o.TIME_FORMAT)}):s("timeFrom",{start:u.DateTime.fromISO(i.start).toFormat(o.TIME_FORMAT)}):null))}))):null};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.520",
3
+ "version": "0.44.522",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { Col, Row } from "react-bootstrap";
4
4
  import { useFormContext } from "react-hook-form";
5
5
  import { useTranslation } from "react-i18next";
6
- import { useIntl } from "react-intl";
6
+ import { TIME_FORMAT } from "@licklist/core/dist/Config";
7
7
  import { WorkingHoursInputValues } from ".";
8
8
  import { useWeekdays } from "./utils";
9
9
 
@@ -12,7 +12,9 @@ export function WorkingHoursInputDescription() {
12
12
  const values = watch("workingHours");
13
13
  const weekdays = useWeekdays("short");
14
14
  const { t } = useTranslation("Design");
15
- const { formatTime } = useIntl();
15
+
16
+ if (!values) return null;
17
+
16
18
  return (
17
19
  <>
18
20
  {Array.from({ length: weekdays.length }, (_, i) => i)
@@ -26,17 +28,14 @@ export function WorkingHoursInputDescription() {
26
28
  {weekday?.end
27
29
  ? weekday.start
28
30
  ? t("timeInterval", {
29
- start: formatTime(
30
- DateTime.fromISO(weekday.start).toJSDate()
31
- ),
32
- end: formatTime(
33
- DateTime.fromISO(weekday.end).toJSDate()
34
- ),
31
+ start:
32
+ DateTime.fromISO(weekday.start).toFormat(TIME_FORMAT),
33
+ end:
34
+ DateTime.fromISO(weekday.start).toFormat(TIME_FORMAT),
35
35
  })
36
36
  : t("timeFrom", {
37
- start: formatTime(
38
- DateTime.fromISO(weekday.start).toJSDate()
39
- ),
37
+ start:
38
+ DateTime.fromISO(weekday.start).toFormat(TIME_FORMAT),
40
39
  })
41
40
  : null}
42
41
  </Col>