<commit_before>import '../styles/datepicker.css';
import { Calendar } from './calendar';
import { isSame, prevMonth, nextMonth } from './date';
import { todayDecorator, outMonthDecorator, thisMonthDecorator, selectedDecorator} from './decorators';
import { createNode } from './util';

const LANGUAGE = window.navigator.language;
const WEEKDAYS = 'sun_mon_tue_wed_thu_fri_sat'.split('_');
const TEMPLATE =
  `<div class="arrow"></div>
    <div class="header">
      <span class="prev"></span>
      <span class="title"></span>
      <span class="next"></span>
    </div>
    <div class="weekdays"></div>
  <div class="days"></div>`;

const doc = window.document;

export class DatePicker {

  constructor(options) {
    this.options = {
      currentDate: new Date(),
      selector: null,
      updateInput: true,
      appendTo: 'body',
      language: LANGUAGE,
      weekdays: WEEKDAYS,
      template: TEMPLATE,
      formatInputDate: date => this.formatInputDate(date),
      formatTitleDate: date => this.formatTitleDate(date)
    };
    this.options = { ...this.options, ...options };
    this.options.currentMonth = Object.assign(this.options.currentDate);

    this.setupParentElement();
    this.updateInputDate(this.options.currentDate);
    this.setupCalendar();<commit_msg>renaming this.options variable to initialState<commit_after>import '../styles/datepicker.css';
import { Calendar } from './calendar';
import { isSame, prevMonth, nextMonth } from './date';
import { todayDecorator, outMonthDecorator, thisMonthDecorator, selectedDecorator} from './decorators';
import { createNode } from './util';

const LANGUAGE = window.navigator.language;
const WEEKDAYS = 'sun_mon_tue_wed_thu_fri_sat'.split('_');
const TEMPLATE =
  `<div class="arrow"></div>
    <div class="header">
      <span class="prev"></span>
      <span class="title"></span>
      <span class="next"></span>
    </div>
    <div class="weekdays"></div>
  <div class="days"></div>`;

const doc = window.document;

export class DatePicker {

  constructor(options) {
    const initalState = {
      currentDate: new Date(),
      selector: null,
      updateInput: true,
      appendTo: 'body',
      language: LANGUAGE,
      weekdays: WEEKDAYS,
      template: TEMPLATE,
      formatInputDate: date => this.formatInputDate(date),
      formatTitleDate: date => this.formatTitleDate(date)
    };
    this.options = { ...initalState, ...options };
    this.options.currentMonth = Object.assign(this.options.currentDate);

    this.setupParentElement();
    this.updateInputDate(this.options.currentDate);
    this.setupCalendar();
{'fraction_non_alphanumeric': 0.14975105323630794, 'fraction_numerical': 0.0, 'mean_word_length': 3.757741347905282, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 35, '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': '4408514', 'n_tokens_mistral': 814, 'n_tokens_neox': 795, 'n_words': 170}