Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

feat: [BB-333] implement datepickers #342

Merged
merged 9 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const CalculateNutrientsComponent: FC<InputModuleProps> = ({
id: fertilizersDetails[selectedIndex].id,
fertilizerTypeId: fertilizersDetails[selectedIndex].fertilizerTypeId,
fertilizerId: fertilizersDetails[selectedIndex].fertilizerId,
applDate: new Date(values.applDate).toISOString(),
customN: fertBalance.N,
customP2o5: fertBalance.P,
customK2o: fertBalance.K,
Expand Down Expand Up @@ -396,7 +397,7 @@ const CalculateNutrientsComponent: FC<InputModuleProps> = ({
label="Date (optional)"
name="applDate"
id="applDate"
type="text"
type="date"
kcaparas1630 marked this conversation as resolved.
Show resolved Hide resolved
desktopWidth="50%"
/>
</StyledSmallFormGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const FieldsAndSoilComponent: FC<InputModuleProps> = ({
HasSoilTest: values.HasSoilTest,
SoilTest: {
TestingMethod: values.SoilTest.TestingMethod,
sampleDate: values.SoilTest.sampleDate,
sampleDate: new Date(values.SoilTest.sampleDate).toISOString(),
valNO3H: values.SoilTest.valNO3H,
ValP: values.SoilTest.ValP,
valK: values.SoilTest.valK,
Expand Down Expand Up @@ -346,7 +346,7 @@ const FieldsAndSoilComponent: FC<InputModuleProps> = ({
label="Sample Month"
id="SoilTest.sampleDate"
name="SoilTest.sampleDate"
type="text"
type="date"
mobileWidth="223px"
desktopWidth="226px"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ const FieldsListComponent: FC<FieldListProps> = ({ farmDetails }) => {
marginRight="50px"
>
<h2>Sampling Month</h2>
<p>{HasSoilTest ? SoilTest.sampleDate : ComponentText.NA}</p>
<p>
{HasSoilTest
? new Date(SoilTest.sampleDate).toLocaleDateString('en-US', {
timeZone: 'UTC',
month: 'long',
year: 'numeric',
})
: ComponentText.NA}
</p>
</StyledListItem>
<StyledListItemGroup desktopWidth="25%">
<StyledListItem
Expand Down
Loading