UNPKG

sui-explorer-local

Version:
2 lines (1 loc) 853 B
import{j as o}from"./jsx-runtime-ffb262ed.js";import"./index-76fb7be0.js";import{T as c}from"./Text-6932fd32.js";function u(e,t){const i=t??["month","day","hour","minute"],r=new Date(e);if(!(r instanceof Date))return"";const m={year:"numeric",month:"short",day:"numeric",hour:"numeric",weekday:"short",minute:"numeric",second:"numeric"},s=i.reduce((d,n)=>({...d,[n]:m[n]}),{});return new Intl.DateTimeFormat("en-US",s).format(r)}function a({date:e}){const t=u(e,["month","day","year","hour","minute"]);return t?o.jsx(c,{variant:"bodySmall/semibold",color:"steel-dark",children:o.jsx("time",{dateTime:new Date(e).toISOString(),children:t})}):null}try{a.displayName="DateCard",a.__docgenInfo={description:"",displayName:"DateCard",props:{date:{defaultValue:null,description:"",name:"date",required:!0,type:{name:"number | Date"}}}}}catch{}export{a as D};