<commit_before>import moment from 'moment'

/**
 * Defines a range between two moment objects.
 */
export default class MomentRange {
  /**
   * Get the default range for our datetime range components.
   *
   * Can be used for a sane default datetime picker range by other
   * widgets/components.
   *
   * @returns {MomentRange}
   */
  static defaultForDatetimeSelect () {
    return new MomentRange(
      moment({
        year: 1900,
        month: 0,
        day: 0
      }),
      moment({
        year: 2100,
        month: 0,
        day: 0
      }).subtract(1, 'second')
    )
  }

  /**
   * @param start Moment object for the start of the range. Defaults to NOW if not provided.
   * @param end Moment object for the end of the range. Defaults to NOW if not provided.
   */
  constructor (start = null, end = null) {
    this.start = start || moment()
    this.end = end || moment()
    if (!this.end.isAfter(this.start)) {
      throw new Error('The end of a MomentRange must be after the start.')
    }
  }

  /**
   * Prettyformat the range.
   *
   * @param args Forwarded to moment.format() for formatting of both the endpoints in the range.
   * @returns {string}
   */
  format (...args) {
    return `${this.start.format(...args)} - ${this.end.format(...args)}`
  }

  /**
   * Is the provided moment object within the range?
   *
   * @param momentObject
   * @returns {boolean}
   */
  contains (momentObject) {
    return this.start.isSameOrBefore(momentObject) && this.end.isSameOrAfter(momentObject)
  }<commit_msg>cradmin_js...MomentRange: Fix incorrect default range.<commit_after>import moment from 'moment'

/**
 * Defines a range between two moment objects.
 */
export default class MomentRange {
  /**
   * Get the default range for our datetime range components.
   *
   * Can be used for a sane default datetime picker range by other
   * widgets/components.
   *
   * @returns {MomentRange}
   */
  static defaultForDatetimeSelect () {
    return new MomentRange(
      moment({
        year: 1900,
        month: 1,
        day: 1
      }),
      moment({
        year: 2100,
        month: 1,
        day: 1
      }).subtract(1, 'second')
    )
  }

  /**
   * @param start Moment object for the start of the range. Defaults to NOW if not provided.
   * @param end Moment object for the end of the range. Defaults to NOW if not provided.
   */
  constructor (start = null, end = null) {
    this.start = start || moment()
    this.end = end || moment().add(1, 'seconds')
    if (!this.end.isAfter(this.start)) {
      throw new Error('The end of a MomentRange must be after the start.')
    }
  }

  /**
   * Prettyformat the range.
   *
   * @param args Forwarded to moment.format() for formatting of both the endpoints in the range.
   * @returns {string}
   */
  format (...args) {
    return `${this.start.format(...args)} - ${this.end.format(...args)}`
  }

  /**
   * Is the provided moment object within the range?
   *
   * @param momentObject
   * @returns {boolean}
   */
  contains (momentObject) {
    return this.start.isSameOrBefore(momentObject) && this.end.isSameOrAfter(momentObject)
  }
{'fraction_non_alphanumeric': 0.12066220948742439, 'fraction_numerical': 0.008595988538681949, 'mean_word_length': 2.433879781420765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5837094', 'n_tokens_mistral': 992, 'n_tokens_neox': 943, 'n_words': 321}