{"ast":null,"code":"import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDecade\n * @category Decade Helpers\n * @summary Get the decade of the given date.\n *\n * @description\n * Get the decade of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The year of decade\n *\n * @example\n * // Which decade belongs 27 November 1942?\n * const result = getDecade(new Date(1942, 10, 27))\n * //=> 1940\n */\nexport function getDecade(date) {\n  // TODO: Switch to more technical definition in of decades that start with 1\n  // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking\n  // change, so it can only be done in 4.0.\n  const _date = toDate(date);\n  const year = _date.getFullYear();\n  const decade = Math.floor(year / 10) * 10;\n  return decade;\n}\n\n// Fallback for modularized imports:\nexport default getDecade;","map":{"version":3,"names":["toDate","getDecade","date","_date","year","getFullYear","decade","Math","floor"],"sources":["/root/rfcontavagas_hom/12.-Servidor-local-Docker/Front-Parking-Angular/node_modules/date-fns/getDecade.mjs"],"sourcesContent":["import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDecade\n * @category Decade Helpers\n * @summary Get the decade of the given date.\n *\n * @description\n * Get the decade of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The year of decade\n *\n * @example\n * // Which decade belongs 27 November 1942?\n * const result = getDecade(new Date(1942, 10, 27))\n * //=> 1940\n */\nexport function getDecade(date) {\n  // TODO: Switch to more technical definition in of decades that start with 1\n  // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking\n  // change, so it can only be done in 4.0.\n  const _date = toDate(date);\n  const year = _date.getFullYear();\n  const decade = Math.floor(year / 10) * 10;\n  return decade;\n}\n\n// Fallback for modularized imports:\nexport default getDecade;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,IAAI,EAAE;EAC9B;EACA;EACA;EACA,MAAMC,KAAK,GAAGH,MAAM,CAACE,IAAI,CAAC;EAC1B,MAAME,IAAI,GAAGD,KAAK,CAACE,WAAW,CAAC,CAAC;EAChC,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACJ,IAAI,GAAG,EAAE,CAAC,GAAG,EAAE;EACzC,OAAOE,MAAM;AACf;;AAEA;AACA,eAAeL,SAAS","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}