<commit_before>import React from 'react';

import CodeBlock from '../../ui/CodeBlock';
import Anchor from '../../ui/Anchor';
import DocPage from '../../containers/DocPage';
import ApiDocs from '../../containers/ApiDocs';

export default () => (
  <DocPage title="DateUtils API">
    <p>Set of functions useful to work with dates and modifiers.</p>
    <CodeBlock>{`import { DateUtils } from "react-day-picker";`}</CodeBlock>
    <hr />

    <ApiDocs>
      <h2>Functions</h2>
      <h3>
        <Anchor id="addDayToRange" />
        addDayToRange{' '}
        <code>
          (day: Date, range: ?Object&lt;from: ?Date, to: ?Date&gt;) ⇒
          Object&lt;from: ?Date, to: ?Date&gt;
        </code>
      </h3>
      <p>
        Add <code>day</code> to a range of days, returning a new range including
        that day. A range is an object with <code>from</code> and{' '}
        <code>to</code> keys. See the range example for an example using this
        function.
      </p>
      <CodeBlock>{`import { DateUtils } from "react-day-picker";

const range = {
  from: new Date(2015, 5, 14),
  to: new Date(2015, 5, 18)
}
const newRange = DateUtils.addDayToRange(new Date(2015, 5, 24), range);

console.log(newRange.from) // 2015-05-24`}</CodeBlock>

      <h3>
        <Anchor id="addMonths" />
        addMonths <code>(date: Date, n: number) ⇒ Date</code>
      </h3>
      <p>
        Return <code>date</code> as a new Date with <code>n</code> months added.
        Missing days will be added to the final date, e.g.{' '}
        <code>2016-03-31 + 1 month = 2016-05-01</code> (since the 31th of April
        is missing).
      </p>

      <h3>
        <Anchor id="clone" />
        clone <code>(date: date) ⇒ Date</code>
      </h3>
      <p><commit_msg>Update DateUtils.js<commit_after>import React from 'react';

import CodeBlock from '../../ui/CodeBlock';
import Anchor from '../../ui/Anchor';
import DocPage from '../../containers/DocPage';
import ApiDocs from '../../containers/ApiDocs';

export default () => (
  <DocPage title="DateUtils API">
    <p>Set of functions useful to work with dates and modifiers.</p>
    <CodeBlock>{`import { DateUtils } from "react-day-picker";`}</CodeBlock>
    <hr />

    <ApiDocs>
      <h2>Functions</h2>
      <h3>
        <Anchor id="addDayToRange" />
        addDayToRange{' '}
        <code>
          (day: Date, range: ?Object&lt;from: ?Date, to: ?Date&gt;) ⇒
          Object&lt;from: ?Date, to: ?Date&gt;
        </code>
      </h3>
      <p>
        Add <code>day</code> to a range of days, returning a new range including
        that day. A range is an object with <code>from</code> and{' '}
        <code>to</code> keys. See the range example for an example using this
        function.
      </p>
      <CodeBlock>{`import { DateUtils } from "react-day-picker";

const range = {
  from: new Date(2015, 5, 14),
  to: new Date(2015, 5, 18)
}
const newRange = DateUtils.addDayToRange(new Date(2015, 5, 24), range);

console.log(newRange.to) // 2015-05-24`}</CodeBlock>

      <h3>
        <Anchor id="addMonths" />
        addMonths <code>(date: Date, n: number) ⇒ Date</code>
      </h3>
      <p>
        Return <code>date</code> as a new Date with <code>n</code> months added.
        Missing days will be added to the final date, e.g.{' '}
        <code>2016-03-31 + 1 month = 2016-05-01</code> (since the 31th of April
        is missing).
      </p>

      <h3>
        <Anchor id="clone" />
        clone <code>(date: date) ⇒ Date</code>
      </h3>
      <p>
{'fraction_non_alphanumeric': 0.16477595008508225, 'fraction_numerical': 0.03176403857061826, 'mean_word_length': 2.355851569933397, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '221771', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1197, 'n_words': 352}