Skip to content

Delay randomly emits right away when passed the date #7602

@zaalbarxx

Description

@zaalbarxx

Describe the bug

Hello, I'm scratching my head about this for the whole day and I cannot figure it out:
https://stackblitz.com/edit/dayjs-playground-cnp4tnka?file=package.json,index.js

For some reason this fails and I don't understand why:

Image

All of these dates are the future dates, it was checked on multiple machines with both Windows and MacOS and all of them behave the same.

Expected behavior

The should not be called before logs should not be logged due to the dates being in the future.

Reproduction code

of('test')
  .pipe(delay(new Date(2026, 9, 11, 18, 0, 5)))
  .subscribe(() => {
    console.log(
      `should not be called before  ${new Date(
        2026,
        9,
        11,
        18,
        0,
        5
      ).toString()}`
    );
  });

Reproduction URL

https://stackblitz.com/edit/dayjs-playground-cnp4tnka?file=package.json,index.js

Version

7.8.2

Environment

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions