{"version":3,"file":"DateTimeDisplay.B2RB5H0L.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/rVbuTOVxxJ1CBwKL8Age/BnPtMTwsFsxfxj0q8TJJ/DateTimeDisplay.js"],"sourcesContent":["// Date, month and time component that displays current date, month and time\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function DateTimeDisplay(props){const{showDate=true,showMonth=true,showTime=true,showSeconds=false,format24Hour=true,dateFormat=\"numeric\",monthFormat=\"long\",separator=\" • \",textColor=\"#000000\",font}=props;const[currentTime,setCurrentTime]=useState(new Date);useEffect(()=>{const timer=setInterval(()=>{startTransition(()=>{setCurrentTime(new Date);});},1e3);return()=>clearInterval(timer);},[]);const formatDate=date=>{const options={};if(dateFormat===\"numeric\"){options.day=\"numeric\";}else if(dateFormat===\"short\"){options.day=\"2-digit\";}else{options.day=\"numeric\";}return date.toLocaleDateString(undefined,options);};const formatMonth=date=>{const options={};if(monthFormat===\"numeric\"){options.month=\"numeric\";}else if(monthFormat===\"short\"){options.month=\"short\";}else{options.month=\"long\";}return date.toLocaleDateString(undefined,options);};const formatTime=date=>{const options={hour:\"2-digit\",minute:\"2-digit\",hour12:!format24Hour};if(showSeconds){options.second=\"2-digit\";}return date.toLocaleTimeString(undefined,options);};const parts=[];// Group date and month together\nconst dateMonthParts=[];if(showDate){dateMonthParts.push(formatDate(currentTime));}if(showMonth){dateMonthParts.push(formatMonth(currentTime));}if(dateMonthParts.length>0){parts.push(dateMonthParts.join(\" \"));}if(showTime){parts.push(formatTime(currentTime));}const displayText=parts.join(separator);return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,color:textColor,width:\"max-content\",minWidth:\"max-content\",...font},children:displayText});}addPropertyControls(DateTimeDisplay,{showDate:{type:ControlType.Boolean,title:\"Show Date\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showMonth:{type:ControlType.Boolean,title:\"Show Month\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showTime:{type:ControlType.Boolean,title:\"Show Time\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\",hidden:({showTime})=>!showTime},format24Hour:{type:ControlType.Boolean,title:\"24 Hour Format\",defaultValue:true,enabledTitle:\"24h\",disabledTitle:\"12h\",hidden:({showTime})=>!showTime},dateFormat:{type:ControlType.Enum,title:\"Date Format\",options:[\"numeric\",\"short\",\"long\"],optionTitles:[\"1\",\"01\",\"1st\"],defaultValue:\"numeric\",hidden:({showDate})=>!showDate},monthFormat:{type:ControlType.Enum,title:\"Month Format\",options:[\"numeric\",\"short\",\"long\"],optionTitles:[\"1\",\"Jan\",\"January\"],defaultValue:\"long\",hidden:({showMonth})=>!showMonth},separator:{type:ControlType.String,title:\"Separator\",defaultValue:\" • \",placeholder:\"Enter separator...\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DateTimeDisplay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DateTimeDisplay.map"],"mappings":"wLAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,GAAK,YAAU,GAAK,WAAS,GAAK,cAAY,GAAM,eAAa,GAAK,aAAW,UAAU,cAAY,OAAO,YAAU,MAAM,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