import moment from "jalali-moment";

export const periodOfYear = (year) => {
    const isLeapYear = moment.jIsLeapYear(year);
    const firstDayGeorgian = moment.from(`${year}/01/01`, 'fa').format('YYYY-MM-DD');
    const lastDayGeorgian = moment.from(`${year}/12/${isLeapYear ? '30' : '29'}`, 'fa').format('YYYY-MM-DD');
    return {
        from: firstDayGeorgian,
        to: lastDayGeorgian
    }
}