Skip to content

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

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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

Activity

  1. github-actions commented on Dec 14, 2023

    @github-actions
    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.
  2. melvin-bot commented on Dec 14, 2023

    @melvin-bot

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

  3. ZhenjaHorbach commented on Dec 14, 2023

    @ZhenjaHorbach
    Contributor

    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));
    };

  4. iwiznia commented on Dec 14, 2023

    @iwiznia
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions