4c1b783e3947c07b3360856ba4def01c52be227273d420da04b1273aab3245a2.json 2.5 KB

1
  1. {"ast":null,"code":"/**\n * @name startOfYesterday\n * @category Day Helpers\n * @summary Return the start of yesterday.\n * @pure false\n *\n * @description\n * Return the start of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nexport default function startOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","map":{"version":3,"names":["startOfYesterday","now","Date","year","getFullYear","month","getMonth","day","getDate","date","setFullYear","setHours"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/date-fns/esm/startOfYesterday/index.js"],"sourcesContent":["/**\n * @name startOfYesterday\n * @category Day Helpers\n * @summary Return the start of yesterday.\n * @pure false\n *\n * @description\n * Return the start of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nexport default function startOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,gBAAgBA,CAAA,EAAG;EACzC,IAAIC,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;EACpB,IAAIC,IAAI,GAAGF,GAAG,CAACG,WAAW,CAAC,CAAC;EAC5B,IAAIC,KAAK,GAAGJ,GAAG,CAACK,QAAQ,CAAC,CAAC;EAC1B,IAAIC,GAAG,GAAGN,GAAG,CAACO,OAAO,CAAC,CAAC;EACvB,IAAIC,IAAI,GAAG,IAAIP,IAAI,CAAC,CAAC,CAAC;EACtBO,IAAI,CAACC,WAAW,CAACP,IAAI,EAAEE,KAAK,EAAEE,GAAG,GAAG,CAAC,CAAC;EACtCE,IAAI,CAACE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACzB,OAAOF,IAAI;AACb","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}