UNPKG

@js-sugar/date

Version:

A multi-calendar, tree-shakable, extensible, immutable and lightweight date library for JavaScript

1 lines 1.13 kB
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["jss-date"]=o():e["jss-date"]=o()}(this,(function(){return(this.webpackChunkjss_date=this.webpackChunkjss_date||[]).push([[236,66],{218:(e,o,t)=>{"use strict";t.r(o),t.d(o,{fromJsDate:()=>r});var n=t(157);function r(e,o){const t=n.Calendars.findByType("gregory")[0];if(!t)throw Error("No gregorian calendar found.");let r=n.Zones.resolve((null==o?void 0:o.zone)||0===(null==o?void 0:o.zone)?o.zone:-1*e.getTimezoneOffset());return new n.DateTime(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds(),{calendar:t,zone:r,locale:null==o?void 0:o.locale})}},979:(e,o,t)=>{"use strict";t.r(o),t.d(o,{parseIso:()=>s});var n=t(157),r=t(218);function s(e,o){if(!n.Calendars.findByType("gregory")[0])throw Error("No gregorian calendar found.");const t=new Date(Date.parse(e));return(0,r.fromJsDate)(t,{zone:null==o?void 0:o.zone,locale:null==o?void 0:o.locale})}}},e=>{"use strict";var o;return o=979,e(e.s=o)}])}));