{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/date-picker/utils.ts"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { format } from 'date-fns';\n\n/**\n * A version of getYearsPeriod copied from https://github.com/Hacker0x01/react-datepicker/blob/main/src/date_utils.ts\n */\nexport function getYearsPeriodString(\n  date: Date,\n  yearItemNumber: number = 12,\n): string {\n  const endPeriod =\n    Math.ceil(+format(date, 'yyyy') / yearItemNumber) * yearItemNumber;\n  const startPeriod = endPeriod - (yearItemNumber - 1);\n  return `${startPeriod}-${endPeriod}`;\n}\n\nexport const daysInMonth = (month: number, year: number) =>\n  new Date(year, month + 1, 0).getDate();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,qBACd,MACA,iBAAyB,IACjB;CACR,MAAM,YACJ,KAAK,KAAK,CAAC,OAAO,MAAM,MAAM,IAAI,cAAc,IAAI;CAEtD,OAAO,GADa,aAAa,iBAAiB,GAC5B,GAAG;AAC3B;AAEA,MAAa,eAAe,OAAe,SACzC,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ"}