Skip to content
Open
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: 5 additions & 2 deletions src/components/EditSections/EditUserInfo/EditUserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ class EditUserInfo extends React.Component {

setRecalculatedExpirationDate = (startCalcToday) => {
const { form: { change } } = this.props;
const recalculatedDate = this.calculateNewExpirationDate(startCalcToday).format('L');
// Use .format() instead of .format('L') to preserve timezone information in the ISO string.
// .format('L') would produce a local date string like "08/31/2025" which loses timezone context,
// causing parseExpirationDate to incorrectly interpret the date and shift it by a day.
// .format() produces an ISO string like "2025-08-31T02:59:59+03:00" that maintains timezone info.
const recalculatedDate = this.calculateNewExpirationDate(startCalcToday).format();
const parsedRecalculatedDate = this.parseExpirationDate(recalculatedDate);

change('expirationDate', parsedRecalculatedDate);
Expand Down Expand Up @@ -374,7 +378,6 @@ class EditUserInfo extends React.Component {
parse={this.parseExpirationDate}
disabled={disabled}
validate={validateMinDate('ui-users.errors.personal.dateOfBirth')}
timeZone="UTC"
/>
{checkShowRecalculateButton() && (
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserDetailSections/UserInfo/UserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const UserInfo = (props) => {
<Col xs={3}>
<KeyValue
label={<FormattedMessage id="ui-users.information.expirationDate" />}
value={user.expirationDate ? <FormattedDate value={user.expirationDate} timeZone="UTC" /> : '-'}
value={user.expirationDate ? <FormattedDate value={user.expirationDate} /> : '-'}
/>
</Col>
<Col xs={3}>
Expand Down
Loading