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

Status - Error when saving the custom time at 00:00 am #33093

Closed
6 tasks done
lanitochka17 opened this issue Dec 14, 2023 · 4 comments
Closed
6 tasks done

Status - Error when saving the custom time at 00:00 am #33093

lanitochka17 opened this issue Dec 14, 2023 · 4 comments
Assignees
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 14, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.13.0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Settings > Profile
  3. Go to Status
  4. Click Clear after > Custom > Time
  5. Select a date later than today
  6. Set the time to 00:00 am and save it

Expected Result:

User is able to save the custom time when the time is 00:00 am

Actual Result:

User is unable to save the custom time when the time is 00:00 am
Error shows up - Please choose a time at least one minute ahead
Although it says 'choose a time at least one minute ahead', user is still unable to set the time at 00:01, 00:02 etc

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6313346_1702573801473.bandicam_2023-12-15_00-01-26-834__1_.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Dec 14, 2023
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Dec 14, 2023

Triggered auto assignment to @iwiznia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Dec 14, 2023

Regression from #24620

const validate = useCallback(
(time) => {
const isValid = DateUtils.isTimeAtLeastOneMinuteInFuture({timeString: time || `${hours}:${minute} ${amPmValue}`, dateTimeString: defaultValue});
setError(!isValid);
return isValid;
},
[hours, minute, amPmValue, defaultValue],
);

We will always get an error if we have 0 hours

App/src/libs/DateUtils.ts

Lines 600 to 620 in 4aa6b03

const isTimeAtLeastOneMinuteInFuture = ({timeString, dateTimeString}: {timeString?: string; dateTimeString: string}): boolean => {
let dateToCheck = dateTimeString;
if (timeString) {
// return false;
// Parse the hour and minute from the time input
const [hourStr] = timeString.split(/[:\s]+/);
const hour = parseInt(hourStr, 10);
if (hour === 0) {
return false;
}
dateToCheck = combineDateAndTime(timeString, dateTimeString);
}
// Get current date and time
const now = new Date();
// Check if the combinedDate is at least one minute later than the current date and time
return isAfter(new Date(dateToCheck), addMinutes(now, 1));
};

@iwiznia
Copy link
Contributor

iwiznia commented Dec 14, 2023

See https://expensify.slack.com/archives/C01GTK53T8Q/p1702577037928319
Not a blocker, 0 is not a valid hour, it should be 12. We will change the error message to be better.

@iwiznia iwiznia closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2
Projects
None yet
Development

No branches or pull requests

3 participants