@js-sugar/date
Version:
A multi-calendar, tree-shakable, extensible, immutable and lightweight date library for JavaScript
1 lines • 822 B
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["jss-date"]=t():e["jss-date"]=t()}(this,(function(){return(this.webpackChunkjss_date=this.webpackChunkjss_date||[]).push([[66],{218:(e,t,o)=>{"use strict";o.r(t),o.d(t,{fromJsDate:()=>s});var n=o(157);function s(e,t){const o=n.Calendars.findByType("gregory")[0];if(!o)throw Error("No gregorian calendar found.");let s=n.Zones.resolve((null==t?void 0:t.zone)||0===(null==t?void 0:t.zone)?t.zone:-1*e.getTimezoneOffset());return new n.DateTime(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds(),{calendar:o,zone:s,locale:null==t?void 0:t.locale})}}},e=>{"use strict";var t;return t=218,e(e.s=t)}])}));