fluentfixture
ContributionCode of Conduct
  • Fluent Fixture
  • PACKAGES
    • @fluentfixture/core
      • Everything Is A Factory
      • Streams
        • Stream
        • Boolean Stream
        • Number Stream
        • String Stream
        • Date Stream
        • Array Stream
        • Object Stream
      • Generators
      • Live Demo
    • @fluentfixture/format
      • Structure
      • Pipe Functions
        • Built-In Pipes
        • Custom Pipes
      • How To Use
      • Error Handling
      • Live Demo
  • 🫂Contribution
  • 🐦Follow me on Twitter :)
Powered by GitBook
On this page
  • addMilliseconds()
  • subtractMilliseconds()
  • setMilliseconds()
  • getMilliseconds()
  • addSeconds()
  • subtractSeconds()
  • setSeconds()
  • getSeconds()
  • addHours()
  • subtractHours()
  • setHours()
  • getHours()
  • addDays()
  • subtractDays()
  • setDaysOfMonth()
  • setDaysOfWeek()
  • getDaysOfMonth()
  • getDaysOfWeek()
  • addMonths()
  • subtractMonths()
  • setMonths()
  • getMonths()
  • addYears()
  • subtractYears()
  • setYears()
  • getYears()
Edit on GitHub
  1. PACKAGES
  2. @fluentfixture/core
  3. Streams

Date Stream

PreviousString StreamNextArray Stream

Last updated 7 months ago

The DateStream is a that provides date-related methods.

addMilliseconds()

Returns a that adds milliseconds to the produced output.

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addMilliseconds(10);

console.log(stream.single());
// now + 10 milliseconds

subtractMilliseconds()

Returns a that subtracts milliseconds from the produced output.

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractMilliseconds(10);

console.log(stream.single());
// now - 10 milliseconds

setMilliseconds()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setMilliseconds(10);

console.log(stream.single());
// now with milliseconds is 10

getMilliseconds()

import { now } from '@fluentfixture/core';

const stream = now().getMilliseconds();

console.log(stream.single());
// milliseconds part of the now

addSeconds()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addSeconds(10);

console.log(stream.single());
// now + 10 seconds

subtractSeconds()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractSeconds(10);

console.log(stream.single());
// now - 10 seconds

setSeconds()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setSeconds(10);

console.log(stream.single());
// now with seconds is 10

getSeconds()

import { now } from '@fluentfixture/core';

const stream = now().getSeconds();

console.log(stream.single());
// seconds part of the now

addHours()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addHours(10);

console.log(stream.single());
// now + 10 hours

subtractHours()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractHours(10);

console.log(stream.single());
// now - 10 hours

setHours()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setHours(10);

console.log(stream.single());
// now with hours is 10

getHours()

import { now } from '@fluentfixture/core';

const stream = now().getHours();

console.log(stream.single());
// hours part of the now

addDays()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addDays(10);

console.log(stream.single());
// now + 10 days

subtractDays()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractDays(10);

console.log(stream.single());
// now - 10 days

setDaysOfMonth()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setDaysOfMonth(10);

console.log(stream.single());
// now with days of month is 10

setDaysOfWeek()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setDaysOfWeek(2);

console.log(stream.single());
// now with days of week is 2

getDaysOfMonth()

import { now } from '@fluentfixture/core';

const stream = now().getDaysOfMonth();

console.log(stream.single());
// days of month part of the now

getDaysOfWeek()

import { now } from '@fluentfixture/core';

const stream = now().getDaysOfWeek();

console.log(stream.single());
// days of week part of the now

addMonths()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addMonths(10);

console.log(stream.single());
// now + 10 months

subtractMonths()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractMonths(10);

console.log(stream.single());
// now - 10 months

setMonths()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setMonths(10);

console.log(stream.single());
// now with months is 10

getMonths()

import { now } from '@fluentfixture/core';

const stream = now().getMonths();

console.log(stream.single());
// months part of the now

addYears()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().addYears(10);

console.log(stream.single());
// now + 10 years

subtractYears()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().subtractYears(10);

console.log(stream.single());
// now - 10 years

setYears()

Parameter
Type
Default
Description

value

Integer

value

import { now } from '@fluentfixture/core';

const stream = now().setYears(10);

console.log(stream.single());
// now with years is 10

getYears()

import { now } from '@fluentfixture/core';

const stream = now().getYears();

console.log(stream.single());
// years part of the now

Returns a that sets the milliseconds of the produced output.

Returns a with the milliseconds parts of the produced output.

Returns a that adds seconds to the produced output.

Returns a that subtracts seconds from the produced output.

Returns a that sets the seconds of the produced output.

Returns a with the seconds parts of the produced output.

Returns a that adds hours to the produced output.

Returns a that subtracts hours from the produced output.

Returns a that sets the hours of the produced output.

Returns a with the hours parts of the produced output.

Returns a that adds days to the produced output.

Returns a that subtracts days from the produced output.

Returns a that sets the days of month of the produced output.

Returns a that sets the days of week of the produced output.

Returns a with the days of month parts of the produced output.

Returns a with the days of week parts of the produced output.

Returns a that adds months to the produced output.

Returns a that subtracts months from the produced output.

Returns a that sets the months of the produced output.

Returns a with the months parts of the produced output.

Returns a that adds years to the produced output.

Returns a that subtracts years from the produced output.

Returns a that sets the years of the produced output.

Returns a with the years parts of the produced output.

Stream
DateStream
DateStream
DateStream
NumberStream
DateStream
DateStream
DateStream
NumberStream
DateStream
DateStream
DateStream
NumberStream
DateStream
DateStream
DateStream
DateStream
NumberStream
NumberStream
DateStream
DateStream
DateStream
NumberStream
DateStream
DateStream
DateStream
NumberStream