date-fns#getMonth JavaScript Examples

The following examples show how to use date-fns#getMonth. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: date-filters.js    From product-collector with MIT License 5 votes vote down vote up
dateFilters = [
  {
    label: 'Últimos 7 días',
    startAt: format(sub(today, { days: 7 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Últimos 15 días',
    startAt: format(sub(today, { days: 15 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Mes actual',
    startAt: format(new Date(getYear(today), getMonth(today), 1), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Últimos 30 días',
    startAt: format(sub(today, { days: 30 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Últimos 90 días',
    startAt: format(sub(today, { days: 90 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Año actual',
    startAt: format(new Date(getYear(today), 1, 1), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Último año',
    startAt: format(sub(today, { years: 1 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
  {
    label: 'Últimos dos años',
    startAt: format(sub(today, { years: 2 }), 'yyyy-MM-dd'),
    endAt: todayFormat,
  },
]