import { DateUtils } from 'react-day-picker/lib/src/index';
import { DateTime } from 'luxon';

export const convertModifiersToClassnames = (modifiers, theme) => {
  if (!modifiers) {
    return {};
  }

  return Object.keys(modifiers).reduce((convertedModifiers, key) => {
    return {
      ...convertedModifiers,
      [theme[key]]: modifiers[key],
    };
  }, {});
};

export const isSelectingFirstDay = (from, to, day) => {
  const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
  const isRangeSelected = from && to;
  return !from || isBeforeFirstDay || isRangeSelected;
};

export function JSDateToLocaleString(date, locale, format = DateTime.DATE_SHORT) {
  return DateTime.fromJSDate(date)
    .setLocale(locale)
    .toLocaleString(format);
}

@@ -598,16 +598,13 @@
 ort 
-function
+const
  JSD
@@ -620,16 +620,19 @@
 leString
+ = 
 (date, l
@@ -672,18 +672,12 @@
 RT) 
-%7B%0A  return
+=%3E%0A 
  Dat
@@ -751,10 +751,8 @@
 ormat);%0A
-%7D%0A

Convert to arrow function