UNPKG

healthone

Version:

Health One format library for JavaScript

6 lines 523 B
"use strict";var _dateFns=require("date-fns");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=sliceDate;function sliceDate(a){const b=a.slice(0,2),c=a.slice(2,4);let d=a.slice(4,8);if(2===d.length){const a=Number.parseInt(d,10),b=new Date,c=(0,_dateFns.getYear)(b);// The logic is that dates can only be in the past with // those documents // stops working 01 Jan 2100 // hopefully I'll be dead by then d=a<=c%100?`20${d}`:`19${d}`}return{year:d,month:c,day:b}} //# sourceMappingURL=sliceDate.cjs.map