subMilliseconds.cjs 900 B

1234567891011121314151617181920212223
  1. "use strict";
  2. exports.subMilliseconds = subMilliseconds;
  3. var _index = require("./addMilliseconds.cjs");
  4. /**
  5. * The {@link subMilliseconds} function options.
  6. */
  7. /**
  8. * Subtract the specified number of milliseconds from the given date.
  9. *
  10. * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
  11. * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
  12. *
  13. * @param date - The date to be changed
  14. * @param amount - The amount of milliseconds to be subtracted.
  15. * @param options - An object with options
  16. *
  17. * @returns The new date with the milliseconds subtracted
  18. */
  19. function subMilliseconds(date, amount, options) {
  20. return (0, _index.addMilliseconds)(date, -amount, options);
  21. }