@mseva/digit-ui-module-ptr 1.1.12 → 1.1.13
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 +23330 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +152 -40
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -8397,7 +8397,12 @@ const PTRCitizenPet = ({
|
|
|
8397
8397
|
errors
|
|
8398
8398
|
},
|
|
8399
8399
|
trigger
|
|
8400
|
-
} = useForm(
|
|
8400
|
+
} = useForm({
|
|
8401
|
+
defaultValues: {
|
|
8402
|
+
petAge: "",
|
|
8403
|
+
lastVaccineDate: ""
|
|
8404
|
+
}
|
|
8405
|
+
});
|
|
8401
8406
|
const selectedPetType = watch("petType");
|
|
8402
8407
|
function toEpochMilliseconds(dateStr) {
|
|
8403
8408
|
return new Date(dateStr).getTime();
|
|
@@ -8557,7 +8562,6 @@ const PTRCitizenPet = ({
|
|
|
8557
8562
|
}, [selectedVaccineDate, trigger]);
|
|
8558
8563
|
const onlyAlphabets = /^[A-Za-z]+(?:[ '-][A-Za-z]+)*\s*$/;
|
|
8559
8564
|
const alphaNum = /^[A-Za-z0-9]+$/;
|
|
8560
|
-
const decimalNumber = /^\d+(\.\d{1,2})?$/;
|
|
8561
8565
|
const getErrorMessage = fieldName => {
|
|
8562
8566
|
var _errors$fieldName;
|
|
8563
8567
|
if (!errors[fieldName]) return null;
|
|
@@ -8569,6 +8573,19 @@ const PTRCitizenPet = ({
|
|
|
8569
8573
|
fontSize: "12px",
|
|
8570
8574
|
marginTop: "-18px"
|
|
8571
8575
|
};
|
|
8576
|
+
const parsePetAge = raw => {
|
|
8577
|
+
if (!raw) return null;
|
|
8578
|
+
const v = raw.startsWith(".") ? `0${raw}` : raw;
|
|
8579
|
+
const [yStr, mStr] = v.split(".");
|
|
8580
|
+
const years = parseInt(yStr || "0", 10);
|
|
8581
|
+
const months = mStr ? parseInt(mStr, 10) : 0;
|
|
8582
|
+
return {
|
|
8583
|
+
years,
|
|
8584
|
+
months,
|
|
8585
|
+
totalYears: years + months / 12
|
|
8586
|
+
};
|
|
8587
|
+
};
|
|
8588
|
+
const AGE_REGEX = /^(?:(?:[1-9]|1[0-4])(?:\.(?:[1-9]|1[01]))?|15|0?\.(?:[1-9]|1[01]))$/;
|
|
8572
8589
|
return /*#__PURE__*/React.createElement("form", {
|
|
8573
8590
|
onSubmit: handleSubmit(onSubmit)
|
|
8574
8591
|
}, /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
@@ -8721,24 +8738,26 @@ const PTRCitizenPet = ({
|
|
|
8721
8738
|
rules: {
|
|
8722
8739
|
required: t("PTR_PET_AGE_REQUIRED"),
|
|
8723
8740
|
pattern: {
|
|
8724
|
-
value:
|
|
8741
|
+
value: AGE_REGEX,
|
|
8725
8742
|
message: t("PTR_PET_AGE_INVALID")
|
|
8726
8743
|
},
|
|
8727
8744
|
validate: val => {
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
if (
|
|
8731
|
-
|
|
8745
|
+
if (!val) return t("PTR_PET_AGE_REQUIRED");
|
|
8746
|
+
const normalized = val.startsWith(".") ? `0${val}` : val;
|
|
8747
|
+
if (!AGE_REGEX.test(normalized)) return t("PTR_PET_AGE_INVALID_FORMAT");
|
|
8748
|
+
const {
|
|
8749
|
+
years,
|
|
8750
|
+
months
|
|
8751
|
+
} = parsePetAge(normalized);
|
|
8752
|
+
if (months < 0 || months > 11) return t("PTR_PET_AGE_INVALID_MONTHS");
|
|
8753
|
+
if (years > 15 || years === 15 && months > 0) return t("PTR_PET_AGE_MAX");
|
|
8732
8754
|
const vaccDate = watch("lastVaccineDate");
|
|
8733
|
-
if (
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
roundedAge = 1;
|
|
8738
|
-
} else {
|
|
8739
|
-
roundedAge = Math.floor(age);
|
|
8755
|
+
if (vaccDate) {
|
|
8756
|
+
const yearsSinceVaccine = yearsSince(vaccDate);
|
|
8757
|
+
const roundedAge = years > 0 && years < 1 ? 1 : Math.floor(years + months / 12);
|
|
8758
|
+
if (roundedAge < yearsSinceVaccine) return t("PTR_PET_AGE_LESS_THAN_VACC");
|
|
8740
8759
|
}
|
|
8741
|
-
return
|
|
8760
|
+
return true;
|
|
8742
8761
|
}
|
|
8743
8762
|
},
|
|
8744
8763
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
@@ -8748,13 +8767,25 @@ const PTRCitizenPet = ({
|
|
|
8748
8767
|
v = v.replace(/(\..*)\./g, "$1");
|
|
8749
8768
|
props.onChange(v);
|
|
8750
8769
|
},
|
|
8751
|
-
|
|
8752
|
-
onBlur: () => trigger("petAge"),
|
|
8770
|
+
maxlength: 5,
|
|
8753
8771
|
t: t
|
|
8754
8772
|
})
|
|
8755
|
-
})
|
|
8756
|
-
style:
|
|
8757
|
-
|
|
8773
|
+
}), errors.petAge && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
8774
|
+
style: {
|
|
8775
|
+
width: "70%",
|
|
8776
|
+
fontSize: "12px",
|
|
8777
|
+
marginTop: "-18px"
|
|
8778
|
+
}
|
|
8779
|
+
}, getErrorMessage("petAge")), /*#__PURE__*/React.createElement("span", {
|
|
8780
|
+
style: {
|
|
8781
|
+
fontSize: "12px",
|
|
8782
|
+
color: "#666"
|
|
8783
|
+
}
|
|
8784
|
+
}, "Example: 0.5 (5 months), 1.2 (1 year 2 months)"))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
8785
|
+
style: {
|
|
8786
|
+
marginTop: "15px"
|
|
8787
|
+
}
|
|
8788
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
8758
8789
|
className: "card-label-smaller"
|
|
8759
8790
|
}, t("PTR_VACCINATION_NUMBER"), " *"), /*#__PURE__*/React.createElement("div", {
|
|
8760
8791
|
className: "field"
|
|
@@ -17460,20 +17491,23 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17460
17491
|
window.open(thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[0], "_blank");
|
|
17461
17492
|
}
|
|
17462
17493
|
const getTimelineCaptions = checkpoint => {
|
|
17494
|
+
console.log("checkpoint", checkpoint);
|
|
17463
17495
|
if (checkpoint.state === "OPEN") {
|
|
17464
|
-
var _checkpoint$auditDeta, _props$application4;
|
|
17496
|
+
var _checkpoint$auditDeta, _props$application4, _checkpoint$assigner;
|
|
17465
17497
|
const caption = {
|
|
17466
17498
|
date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
|
|
17467
|
-
source: ((_props$application4 = props.application) === null || _props$application4 === void 0 ? void 0 : _props$application4.channel) || ""
|
|
17499
|
+
source: ((_props$application4 = props.application) === null || _props$application4 === void 0 ? void 0 : _props$application4.channel) || "",
|
|
17500
|
+
mobileNumber: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.mobileNumber
|
|
17468
17501
|
};
|
|
17469
17502
|
return /*#__PURE__*/React.createElement(PTRWFCaption, {
|
|
17470
17503
|
data: caption
|
|
17471
17504
|
});
|
|
17472
17505
|
} else if (checkpoint.state) {
|
|
17473
|
-
var _checkpoint$auditDeta2, _checkpoint$
|
|
17506
|
+
var _checkpoint$auditDeta2, _checkpoint$assigner2, _checkpoint$assigner3, _checkpoint$wfComment, _checkpoint$wfDocumen, _checkpoint$wfDocumen2;
|
|
17474
17507
|
const caption = {
|
|
17475
17508
|
date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta2 = checkpoint.auditDetails) === null || _checkpoint$auditDeta2 === void 0 ? void 0 : _checkpoint$auditDeta2.lastModified,
|
|
17476
|
-
name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$
|
|
17509
|
+
name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner2 = checkpoint.assigner) === null || _checkpoint$assigner2 === void 0 ? void 0 : _checkpoint$assigner2.name,
|
|
17510
|
+
mobileNumber: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner3 = checkpoint.assigner) === null || _checkpoint$assigner3 === void 0 ? void 0 : _checkpoint$assigner3.mobileNumber,
|
|
17477
17511
|
comment: checkpoint.state === "INITIATED" ? null : checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$wfComment = checkpoint.wfComment) === null || _checkpoint$wfComment === void 0 ? void 0 : _checkpoint$wfComment[0],
|
|
17478
17512
|
wfDocuments: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.wfDocuments,
|
|
17479
17513
|
thumbnailsToShow: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.thumbnailsToShow
|
|
@@ -17489,10 +17523,10 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17489
17523
|
index: index
|
|
17490
17524
|
})))));
|
|
17491
17525
|
} else {
|
|
17492
|
-
var _props$application5, _checkpoint$
|
|
17526
|
+
var _props$application5, _checkpoint$assigner4;
|
|
17493
17527
|
const caption = {
|
|
17494
17528
|
date: Digit.DateUtils.ConvertTimestampToDate((_props$application5 = props.application) === null || _props$application5 === void 0 ? void 0 : _props$application5.auditDetails.lastModified),
|
|
17495
|
-
name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$
|
|
17529
|
+
name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner4 = checkpoint.assigner) === null || _checkpoint$assigner4 === void 0 ? void 0 : _checkpoint$assigner4.name,
|
|
17496
17530
|
comment: t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment)
|
|
17497
17531
|
};
|
|
17498
17532
|
return /*#__PURE__*/React.createElement(PTRWFCaption, {
|
|
@@ -18786,7 +18820,7 @@ function get(object, path, defaultValue) {
|
|
|
18786
18820
|
var get_1 = get;
|
|
18787
18821
|
|
|
18788
18822
|
const PTRApplicationDetails = () => {
|
|
18789
|
-
var _pet_details$addition, _reciept_data$Payment, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$
|
|
18823
|
+
var _pet_details$addition, _reciept_data$Payment, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai7;
|
|
18790
18824
|
const {
|
|
18791
18825
|
t
|
|
18792
18826
|
} = useTranslation();
|
|
@@ -19349,7 +19383,7 @@ const PTRApplicationDetails = () => {
|
|
|
19349
19383
|
Payments: [{
|
|
19350
19384
|
...payments
|
|
19351
19385
|
}]
|
|
19352
|
-
}, "
|
|
19386
|
+
}, "petservice-receipt");
|
|
19353
19387
|
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
19354
19388
|
fileStoreIds: response.filestoreIds[0]
|
|
19355
19389
|
});
|
|
@@ -19383,6 +19417,27 @@ const PTRApplicationDetails = () => {
|
|
|
19383
19417
|
}
|
|
19384
19418
|
});
|
|
19385
19419
|
}
|
|
19420
|
+
const formatPetAge = (ageValue, t) => {
|
|
19421
|
+
if (ageValue === null || ageValue === undefined || ageValue === "") return t("CS_NA");
|
|
19422
|
+
const ageStr = String(ageValue).trim();
|
|
19423
|
+
if (!/^\d+(\.\d+)?$/.test(ageStr)) return t("CS_NA");
|
|
19424
|
+
const [yearsPart, decPart] = ageStr.split(".");
|
|
19425
|
+
let years = Number(yearsPart) || 0;
|
|
19426
|
+
let months = 0;
|
|
19427
|
+
if (decPart) {
|
|
19428
|
+
if (decPart.length === 1) {
|
|
19429
|
+
months = parseInt(decPart, 10);
|
|
19430
|
+
} else {
|
|
19431
|
+
months = parseInt(decPart.slice(0, 2), 10);
|
|
19432
|
+
}
|
|
19433
|
+
if (isNaN(months)) months = 0;
|
|
19434
|
+
}
|
|
19435
|
+
if (months > 11) months = 11;
|
|
19436
|
+
if (years === 0 && months === 0) return t("CS_NA");
|
|
19437
|
+
if (years === 0) return `${months} month${months > 1 ? "s" : ""}`;
|
|
19438
|
+
if (months === 0) return `${years} year${years > 1 ? "s" : ""}`;
|
|
19439
|
+
return `${years} year${years > 1 ? "s" : ""} and ${months} month${months > 1 ? "s" : ""}`;
|
|
19440
|
+
};
|
|
19386
19441
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
19387
19442
|
className: "cardHeaderWithOptions",
|
|
19388
19443
|
style: {
|
|
@@ -19446,22 +19501,38 @@ const PTRApplicationDetails = () => {
|
|
|
19446
19501
|
className: "border-none",
|
|
19447
19502
|
label: t("PTR_SEARCH_BREED_TYPE"),
|
|
19448
19503
|
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai2 = pet_details.petDetails) === null || _pet_details$petDetai2 === void 0 ? void 0 : _pet_details$petDetai2.breedType) || t("CS_NA")
|
|
19504
|
+
}), /*#__PURE__*/React.createElement(Row, {
|
|
19505
|
+
className: "border-none",
|
|
19506
|
+
label: t("PTR_PET_AGE"),
|
|
19507
|
+
text: formatPetAge(pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai3 = pet_details.petDetails) === null || _pet_details$petDetai3 === void 0 ? void 0 : _pet_details$petDetai3.petAge, t)
|
|
19449
19508
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
19450
19509
|
className: "border-none",
|
|
19451
19510
|
label: t("PTR_DOCTOR_NAME"),
|
|
19452
|
-
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$
|
|
19511
|
+
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai4 = pet_details.petDetails) === null || _pet_details$petDetai4 === void 0 ? void 0 : _pet_details$petDetai4.doctorName) || t("CS_NA")
|
|
19453
19512
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
19454
19513
|
className: "border-none",
|
|
19455
19514
|
label: t("PTR_CLINIC_NAME"),
|
|
19456
|
-
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$
|
|
19515
|
+
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai5 = pet_details.petDetails) === null || _pet_details$petDetai5 === void 0 ? void 0 : _pet_details$petDetai5.clinicName) || t("CS_NA")
|
|
19457
19516
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
19458
19517
|
className: "border-none",
|
|
19459
19518
|
label: t("PTR_VACCINATED_DATE"),
|
|
19460
|
-
text:
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19519
|
+
text: (_pet_details$petDetai6 => {
|
|
19520
|
+
const rawDate = pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai6 = pet_details.petDetails) === null || _pet_details$petDetai6 === void 0 ? void 0 : _pet_details$petDetai6.lastVaccineDate;
|
|
19521
|
+
if (!rawDate) return t("CS_NA");
|
|
19522
|
+
let dateObj;
|
|
19523
|
+
if (!isNaN(rawDate)) {
|
|
19524
|
+
const timestamp = Number(rawDate);
|
|
19525
|
+
dateObj = new Date(timestamp < 1e12 ? timestamp * 1000 : timestamp);
|
|
19526
|
+
} else {
|
|
19527
|
+
dateObj = new Date(rawDate);
|
|
19528
|
+
}
|
|
19529
|
+
if (isNaN(dateObj.getTime())) return t("CS_NA");
|
|
19530
|
+
return dateObj.toLocaleDateString("en-IN", {
|
|
19531
|
+
day: "2-digit",
|
|
19532
|
+
month: "2-digit",
|
|
19533
|
+
year: "numeric"
|
|
19534
|
+
});
|
|
19535
|
+
})()
|
|
19465
19536
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
19466
19537
|
className: "border-none",
|
|
19467
19538
|
label: t("PTR_VACCINATION_NUMBER"),
|
|
@@ -19544,8 +19615,8 @@ const InboxLinks = ({
|
|
|
19544
19615
|
t
|
|
19545
19616
|
} = useTranslation();
|
|
19546
19617
|
const allLinks = [{
|
|
19547
|
-
text:
|
|
19548
|
-
link: "
|
|
19618
|
+
text: "",
|
|
19619
|
+
link: "",
|
|
19549
19620
|
roles: []
|
|
19550
19621
|
}];
|
|
19551
19622
|
const [links, setLinks] = useState([]);
|
|
@@ -21317,7 +21388,7 @@ const NewApplication = () => {
|
|
|
21317
21388
|
};
|
|
21318
21389
|
|
|
21319
21390
|
const ApplicationDetails = () => {
|
|
21320
|
-
var _pet_details$addition, _reciept_data$Payment2, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$
|
|
21391
|
+
var _pet_details$addition, _reciept_data$Payment2, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai7;
|
|
21321
21392
|
const {
|
|
21322
21393
|
t
|
|
21323
21394
|
} = useTranslation();
|
|
@@ -21475,6 +21546,27 @@ const ApplicationDetails = () => {
|
|
|
21475
21546
|
label: t("PTR_CERTIFICATE"),
|
|
21476
21547
|
onClick: () => printCertificate()
|
|
21477
21548
|
});
|
|
21549
|
+
const formatPetAge = (ageValue, t) => {
|
|
21550
|
+
if (ageValue === null || ageValue === undefined || ageValue === "") return t("CS_NA");
|
|
21551
|
+
const ageStr = String(ageValue).trim();
|
|
21552
|
+
if (!/^\d+(\.\d+)?$/.test(ageStr)) return t("CS_NA");
|
|
21553
|
+
const [yearsPart, decPart] = ageStr.split(".");
|
|
21554
|
+
let years = Number(yearsPart) || 0;
|
|
21555
|
+
let months = 0;
|
|
21556
|
+
if (decPart) {
|
|
21557
|
+
if (decPart.length === 1) {
|
|
21558
|
+
months = parseInt(decPart, 10);
|
|
21559
|
+
} else {
|
|
21560
|
+
months = parseInt(decPart.slice(0, 2), 10);
|
|
21561
|
+
}
|
|
21562
|
+
if (isNaN(months)) months = 0;
|
|
21563
|
+
}
|
|
21564
|
+
if (months > 11) months = 11;
|
|
21565
|
+
if (years === 0 && months === 0) return t("CS_NA");
|
|
21566
|
+
if (years === 0) return `${months} month${months > 1 ? "s" : ""}`;
|
|
21567
|
+
if (months === 0) return `${years} year${years > 1 ? "s" : ""}`;
|
|
21568
|
+
return `${years} year${years > 1 ? "s" : ""} and ${months} month${months > 1 ? "s" : ""}`;
|
|
21569
|
+
};
|
|
21478
21570
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
21479
21571
|
className: "cardHeaderWithOptions",
|
|
21480
21572
|
style: {
|
|
@@ -21537,14 +21629,34 @@ const ApplicationDetails = () => {
|
|
|
21537
21629
|
className: "border-none",
|
|
21538
21630
|
label: t("PTR_CLINIC_NAME"),
|
|
21539
21631
|
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai4 = pet_details.petDetails) === null || _pet_details$petDetai4 === void 0 ? void 0 : _pet_details$petDetai4.clinicName) || t("CS_NA")
|
|
21632
|
+
}), /*#__PURE__*/React.createElement(Row, {
|
|
21633
|
+
className: "border-none",
|
|
21634
|
+
label: t("PTR_PET_AGE"),
|
|
21635
|
+
text: formatPetAge(pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai5 = pet_details.petDetails) === null || _pet_details$petDetai5 === void 0 ? void 0 : _pet_details$petDetai5.petAge, t)
|
|
21540
21636
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
21541
21637
|
className: "border-none",
|
|
21542
21638
|
label: t("PTR_VACCINATED_DATE"),
|
|
21543
|
-
text:
|
|
21639
|
+
text: (_pet_details$petDetai6 => {
|
|
21640
|
+
const rawDate = pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai6 = pet_details.petDetails) === null || _pet_details$petDetai6 === void 0 ? void 0 : _pet_details$petDetai6.lastVaccineDate;
|
|
21641
|
+
if (!rawDate) return t("CS_NA");
|
|
21642
|
+
let dateObj;
|
|
21643
|
+
if (!isNaN(rawDate)) {
|
|
21644
|
+
const timestamp = Number(rawDate);
|
|
21645
|
+
dateObj = new Date(timestamp < 1e12 ? timestamp * 1000 : timestamp);
|
|
21646
|
+
} else {
|
|
21647
|
+
dateObj = new Date(rawDate);
|
|
21648
|
+
}
|
|
21649
|
+
if (isNaN(dateObj.getTime())) return t("CS_NA");
|
|
21650
|
+
return dateObj.toLocaleDateString("en-IN", {
|
|
21651
|
+
day: "2-digit",
|
|
21652
|
+
month: "2-digit",
|
|
21653
|
+
year: "numeric"
|
|
21654
|
+
});
|
|
21655
|
+
})()
|
|
21544
21656
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
21545
21657
|
className: "border-none",
|
|
21546
21658
|
label: t("PTR_VACCINATION_NUMBER"),
|
|
21547
|
-
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$
|
|
21659
|
+
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai7 = pet_details.petDetails) === null || _pet_details$petDetai7 === void 0 ? void 0 : _pet_details$petDetai7.vaccinationNumber) || t("CS_NA")
|
|
21548
21660
|
})), /*#__PURE__*/React.createElement(CardSubHeader, {
|
|
21549
21661
|
style: {
|
|
21550
21662
|
fontSize: "24px"
|