Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make end-of-tour date inclusive #4653

Merged
merged 1 commit into from
Feb 20, 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
7 changes: 6 additions & 1 deletion client/src/pages/people/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { FastField, Field, Form, Formik } from "formik"
import _isEmpty from "lodash/isEmpty"
import _isEqual from "lodash/isEqual"
import { Person } from "models"
import moment from "moment"
import pluralize from "pluralize"
import PropTypes from "prop-types"
import React, { useContext, useRef, useState } from "react"
Expand Down Expand Up @@ -683,7 +684,11 @@ const PersonForm = ({
name="endOfTourDate"
component={FieldHelper.SpecialField}
value={values.endOfTourDate}
onChange={value => setFieldValue("endOfTourDate", value)}
onChange={value =>
setFieldValue(
"endOfTourDate",
moment(value).endOf("day").format()
)}
onBlur={() => setFieldTouched("endOfTourDate")}
widget={
<CustomDateInput id="endOfTourDate" canClearSelection />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void testWarnings() throws Exception {
public void testDeactivation() throws Exception {

// Configure
final Person testPersonEotActive = createDummyPerson(Instant.now().minus(1, ChronoUnit.DAYS),
final Person testPersonEotActive = createDummyPerson(Instant.now().minus(1, ChronoUnit.HOURS),
gjvoosten marked this conversation as resolved.
Show resolved Hide resolved
"test1_eot_acive@test.com", Person.Status.ACTIVE);

final Person testPersonEotInactive = createDummyPerson(Instant.now().minus(1, ChronoUnit.DAYS),
Expand Down
Loading