<commit_before>import $ from 'jquery';

export default function() {
  $(() => {
    fetch('/ws/schema/query/org.irondistrict.special-programs.exit-date.get', {
        credentials: 'same-origin',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json'
        }
      })
      .then(resp => resp.json())
      .then(exitDate => {
        if (exitDate.record.length) {
          const exitDateField = $('.psDateWidget').eq(1);
          const lastDay = exitDate.record[0].lastday;
          if (!exitDateField.val()) {
            exitDateField.val(lastDay);
            exitDateField.prop('disabled', 'disabled');
          }
        }
      });
  });
}<commit_msg>use the readonly attribute instead of disabled, so the exit date is included in the form data<commit_after>import $ from 'jquery';

export default function() {
  $(() => {
    fetch('/ws/schema/query/org.irondistrict.special-programs.exit-date.get', {
        credentials: 'same-origin',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json'
        }
      })
      .then(resp => resp.json())
      .then(exitDate => {
        if (exitDate.record.length) {
          const exitDateField = $('.psDateWidget').eq(1);
          const lastDay = exitDate.record[0].lastday;
          if (!exitDateField.val()) {
            exitDateField.val(lastDay);
            exitDateField.prop('readonly', 'readonly');
          }
        }
      });
  });
}
{'fraction_non_alphanumeric': 0.16023166023166024, 'fraction_numerical': 0.002574002574002574, 'mean_word_length': 2.091451292246521, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6608095', 'n_tokens_mistral': 456, 'n_tokens_neox': 454, 'n_words': 80}