Skip to content

betweenThanTime

Inclusive variant of betweenTime: checks that a TheTime lies between two bounds and includes the endpoints.

Interactive example

Syntax

Standard signature

typescript
function betweenThanTime<
	GenericInput extends TheTime
>(
	input: GenericInput,
	greater: TheTime,
	less: TheTime
): boolean

Curried signature

typescript
function betweenThanTime<
	GenericInput extends TheTime
>(
	greater: TheTime,
	less: TheTime
): (input: GenericInput) => boolean

Parameters

  • greater: Lower bound (inclusive).
  • less: Upper bound (inclusive).
  • input: Duration to test.

Return value

true if the duration is within [greater, less].

See also

Released under the MIT license.