import{_,i as y,e as p,H as f,J as c,D as v,l as V,C as g,o as r,c as d,a as k,t as m,F as w,y as D,U as S,N as I,X as x,k as C,z as T}from"./index-20f16f2f.js";const h={name:"InputCourseDate",props:{modelValue:{type:Object,default:null},noSelectionText:{type:String,default:"[Not selected]"}},setup(l,{emit:o}){const s=y(C.generalTimetableScope).dateRange,a=p(()=>[...S(s.value[0],s.value[1],I({days:1}))]),t=f(null);c(t,()=>{o("update:modelValue",t.value)}),c(()=>l.modelValue,()=>{if(l.modelValue==null){t.value=null;return}const n=a.value.find(u=>u===l.modelValue||T(u,l.modelValue)===0);n!=null&&(t.value=n)},{immediate:!0});const i=v.today();function e(n){const u=n.year==i.year?"%m / %d":"%Y / %m / %d";return`${n.strftime(u)}(${["月","火","水","木","金","土","日"][n.weekday()]})`}return{courseDates:a,internalValue:t,dateToString:e}}},R={value:null},B=["value"];function F(l,o,s,a,t,i){return V((r(),d("select",{"onUpdate:modelValue":o[0]||(o[0]=e=>a.internalValue=e)},[k("option",R,m(s.noSelectionText),1),(r(!0),d(w,null,D(a.courseDates,e=>(r(),d("option",{key:e.isoFormat(),value:e,class:x({"dateoption-weekday":e.weekday()<5,"dateoption-saturday":e.weekday()===5,"dateoption-sunday":e.weekday()===6})},m(a.dateToString(e)),11,B))),128))],512)),[[g,a.internalValue]])}const b=_(h,[["render",F],["__scopeId","data-v-dca0d935"]]);export{b as I};
