import { computed } from 'vue';
import { useLocale } from '../config-provider/useLocale';

const WEEK_NAMES = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
const useWeekNames = (startDay, mode) => {
  const {
    t
  } = useLocale();
  const weekNames = computed(() => {
    if (mode.value === 'month') {
      return [];
    }
    return [...WEEK_NAMES, ...WEEK_NAMES].slice(startDay.value, startDay.value + 7).map(day => t(`datePicker.weeks.${day}`));
  });
  return {
    weekNames
  };
};

export { useWeekNames as default };
