project files added
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
|
||||
|
||||
import { setDate } from 'date-fns'
|
||||
export default setDate
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import toInteger from '../_lib/toInteger/index.js';
|
||||
import toDate from '../toDate/index.js';
|
||||
/**
|
||||
* @name setDate
|
||||
* @category Day Helpers
|
||||
* @summary Set the day of the month to the given date.
|
||||
*
|
||||
* @description
|
||||
* Set the day of the month to the given date.
|
||||
*
|
||||
* ### v2.0.0 breaking changes:
|
||||
*
|
||||
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
||||
*
|
||||
* @param {Date|Number} date - the date to be changed
|
||||
* @param {Number} dayOfMonth - the day of the month of the new date
|
||||
* @returns {Date} the new date with the day of the month set
|
||||
* @throws {TypeError} 2 arguments required
|
||||
*
|
||||
* @example
|
||||
* // Set the 30th day of the month to 1 September 2014:
|
||||
* var result = setDate(new Date(2014, 8, 1), 30)
|
||||
* //=> Tue Sep 30 2014 00:00:00
|
||||
*/
|
||||
|
||||
export default function setDate(dirtyDate, dirtyDayOfMonth) {
|
||||
if (arguments.length < 2) {
|
||||
throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');
|
||||
}
|
||||
|
||||
var date = toDate(dirtyDate);
|
||||
var dayOfMonth = toInteger(dirtyDayOfMonth);
|
||||
date.setDate(dayOfMonth);
|
||||
return date;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// @flow
|
||||
// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
|
||||
|
||||
export type Interval = {
|
||||
start: Date | number,
|
||||
end: Date | number
|
||||
}
|
||||
|
||||
export type Locale = {
|
||||
formatDistance: (...args: Array<any>) => any,
|
||||
formatRelative: (...args: Array<any>) => any,
|
||||
localize: {
|
||||
ordinalNumber: (...args: Array<any>) => any,
|
||||
era: (...args: Array<any>) => any,
|
||||
quarter: (...args: Array<any>) => any,
|
||||
month: (...args: Array<any>) => any,
|
||||
day: (...args: Array<any>) => any,
|
||||
dayPeriod: (...args: Array<any>) => any
|
||||
},
|
||||
formatLong: Object,
|
||||
date: (...args: Array<any>) => any,
|
||||
time: (...args: Array<any>) => any,
|
||||
dateTime: (...args: Array<any>) => any,
|
||||
match: {
|
||||
ordinalNumber: (...args: Array<any>) => any,
|
||||
era: (...args: Array<any>) => any,
|
||||
quarter: (...args: Array<any>) => any,
|
||||
month: (...args: Array<any>) => any,
|
||||
day: (...args: Array<any>) => any,
|
||||
dayPeriod: (...args: Array<any>) => any
|
||||
},
|
||||
options?: {
|
||||
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
||||
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
|
||||
}
|
||||
}
|
||||
|
||||
declare module.exports: (date: Date | number, dayOfMonth: number) => Date
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"typings": "../../typings.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user