1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
import{a as k,n as d}from"./utils-6ebe0a8e.js";import{e as c,i as h,d as o,a as m,t as b,H as g,b as f,f as p,h as D,c as v,j as u,k as _}from"./lifecycle-cafe499b.js";import{S as w,i as C}from"./index-3a0d73e3.js";function y(s){let a,e,t,i;return{c(){a=m("span"),e=b("created "),t=m("date"),i=new g(!1),this.h()},l(l){a=f(l,"SPAN",{});var n=p(a);e=D(n,"created "),t=f(n,"DATE",{datetime:!0});var r=p(t);i=v(r,!1),r.forEach(o),n.forEach(o),this.h()},h(){i.a=null,u(t,"datetime",s[0])},m(l,n){h(l,a,n),_(a,e),_(a,t),i.m(s[1],t)},p(l,n){n&2&&i.p(l[1]),n&1&&u(t,"datetime",l[0])},d(l){l&&o(a)}}}function E(s){let a,e=s[0]&&s[1]&&y(s);return{c(){e&&e.c(),a=c()},l(t){e&&e.l(t),a=c()},m(t,i){e&&e.m(t,i),h(t,a,i)},p(t,[i]){t[0]&&t[1]?e?e.p(t,i):(e=y(t),e.c(),e.m(a.parentNode,a)):e&&(e.d(1),e=null)},i:d,o:d,d(t){t&&o(a),e&&e.d(t)}}}function H(s,a,e){let t,{created_at:i=null}=a,{locale:l="en"}=a;return s.$$set=n=>{"created_at"in n&&e(0,i=n.created_at),"locale"in n&&e(2,l=n.locale)},s.$$.update=()=>{s.$$.dirty&5&&e(1,t=new Intl.DateTimeFormat(l).format(i))},[i,t,l]}class S extends w{constructor(a){super(),C(this,a,H,E,k,{created_at:0,locale:2})}}S.__docgen={version:3,name:"Created.svelte",data:[{keywords:[{name:"type",description:"{Date | null}"}],visibility:"public",description:"Date object for created time.",name:"created_at",kind:"let",static:!1,readonly:!1,type:{kind:"union",text:"Date | null",type:[{kind:"type",text:"Date",type:"Date"},{kind:"type",text:"null",type:"null"}]},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Locale to format the datetime according to.",name:"locale",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"en"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{S as C};
|