당직근무 0.15.7 (웹 2026-11-26.2): 연차 날짜 숫자 빨강 · 반차 추가(파랑) · 위젯 + 표시 빼기

사용자 지시(2026-11-26): 연차는 숫자가 빨간색으로 나오고 반차는 파란색으로, +는 지우기.

- 하루를 쉬는 휴가와 병가(Shift.fullLeave · WorkPlan.fullLeave)를 쓴 날은 날짜 숫자가 빨간색이다. 요일과 공휴일 및 표시 선택보다 우선한다. 앱 달력·위젯·근무표 그림·웹 달력이 같다.
- 반차(HALF_LEAVE)를 더했다. 반나절 근무로 세어 예정시간 기본값은 4시간이고 날짜 숫자는 파란색이다. 근무 순서 이름은 연차처럼 남는다.
- 위젯의 날짜 옆 + 표시를 뺐다. 꾸미기 칸(eventMark)은 목록·오늘 위젯의 일정 개수 글자만 켜고 끈다.
- 기기 시험 WidgetAppearanceCheck에 + 없음과 숫자 색 단계를 더하고 기기에 남은 날짜별 변경을 비우고 시험한다.
- 앱 0.15.7 / 설치 번호 31. APK 877582바이트, SHA-256 9ac008956635a19e0ffae5c5ab79ccdcc6c3967da6533bc739c360372477c6bb
This commit is contained in:
블리어 committed 2026-11-25 15:40:10 +00:00
1 parent 7be9966ca1
commit 2ece130245
32 files changed
+150 -61

No files matched your search

+3 -3
View File
@@ -3,7 +3,7 @@
* 변경을 덧씌워 표시한다. 저장 응답을 놓쳐도 같은 변경 번호를 다시 보내면 중복 적용되지 않는다.
* 충돌한 내용은 별도로 보관하며 사용자가 선택하기 전에는 서버 값을 덮어쓰지 않는다. */
const $ = id => document.getElementById(id);
const labels = {DUTY:'당직',OFF:'비번',REGULAR:'일반근무',DAY:'주간',EVENING:'오후',NIGHT:'야간',REST:'휴무',LEAVE:'연차·휴가',SICK:'병가',TRAINING:'교육',ANNUAL_LEAVE:'연차',MONTHLY_LEAVE:'월차',VACATION:'일반휴가',OFFICIAL_LEAVE:'공가',FAMILY_LEAVE:'경조휴가'};
const labels = {DUTY:'당직',OFF:'비번',REGULAR:'일반근무',DAY:'주간',EVENING:'오후',NIGHT:'야간',REST:'휴무',LEAVE:'연차·휴가',SICK:'병가',TRAINING:'교육',ANNUAL_LEAVE:'연차',HALF_LEAVE:'반차',MONTHLY_LEAVE:'월차',VACATION:'일반휴가',OFFICIAL_LEAVE:'공가',FAMILY_LEAVE:'경조휴가'};
// 일반근무는 회원이 정한 이름(달력 표시의 일반근무 이름)으로 보인다. 근무 식별자 REGULAR는 그대로라 근무표와 다른 사람 자료는 바뀌지 않는다.
const DEFAULT_REGULAR = labels.REGULAR, REGULAR_NAME_MAX = 8;
let regularShort = '일반';
@@ -19,7 +19,7 @@ function relativeLabel(pattern,index){const size=pattern.length,title=labels[pat
function cleanSlotName(value){return String(value??'').trim().split(/\s+/).filter(Boolean).join(' ');}
// 고르는 목록에서는 바꾼 이름이 다른 근무 이름과 같을 때 원래 이름을 덧붙여 구분한다(예: 주간 (일반근무)).
function shiftChoices(){return Object.entries(labels).map(([value,name])=>[value,value==='REGULAR'&&name!==DEFAULT_REGULAR&&Object.entries(labels).some(([other,label])=>other!=='REGULAR'&&label===name)?name+' ('+DEFAULT_REGULAR+')':name]);}
const classes = {DUTY:'duty',OFF:'off',REGULAR:'regular',DAY:'daytime',EVENING:'evening',NIGHT:'night',REST:'rest',LEAVE:'rest',SICK:'rest',TRAINING:'night',ANNUAL_LEAVE:'rest',MONTHLY_LEAVE:'rest',VACATION:'rest',OFFICIAL_LEAVE:'rest',FAMILY_LEAVE:'rest'};
const classes = {DUTY:'duty',OFF:'off',REGULAR:'regular',DAY:'daytime',EVENING:'evening',NIGHT:'night',REST:'rest',LEAVE:'rest',SICK:'rest',TRAINING:'night',ANNUAL_LEAVE:'rest',HALF_LEAVE:'rest',MONTHLY_LEAVE:'rest',VACATION:'rest',OFFICIAL_LEAVE:'rest',FAMILY_LEAVE:'rest'};
const categories = {GENERAL:'개인 일정',WORK:'업무',PARTTIME:'알바·시간근무',LEAVE:'휴가·휴무',BIRTHDAY:'생일',ANNIVERSARY:'기념일'};
const todayKey = () => new Intl.DateTimeFormat('sv-SE',{timeZone:'Asia/Seoul',year:'numeric',month:'2-digit',day:'2-digit'}).format(new Date());
const dayDate = key => new Date(key+'T00:00:00Z');
@@ -122,7 +122,7 @@ function render(){
$('month').textContent=Number(month.slice(0,4))+'년 '+Number(month.slice(5))+'월';
const companions=people();document.body.classList.toggle('with-people',companions.length>0);$('grid').replaceChildren();const first=calendarFirstDate(month,display.weekStart);
$('calendar-weekdays').replaceChildren();for(const day of calendarWeekdays(display.weekStart))$('calendar-weekdays').append(text('span',['일','월','화','수','목','금','토'][day],day===0?'sun':day===6?'sat':''));
for(let i=0;i<42;i++){const date=new Date(first);date.setUTCDate(first.getUTCDate()+i);const key=dateKey(date),shift=shiftOn(key),name=holiday(key),events=eventsOn(key);const button=document.createElement('button');button.type='button';button.className='day'+(key.slice(0,7)!==month?' outside':'')+(key===selected?' selected':'')+(key===today?' current':'')+(date.getUTCDay()===0?' sun':date.getUTCDay()===6?(r&&WorkPlan.regime(r,key).workWeek===5?' sat holiday':' sat'):'')+(name?' holiday':'')+(display.dutyAsWeekday===true&&shift==='DUTY'?' duty-weekday':'')+(display.offAsHoliday===true&&shift==='OFF'?' off-red':'');button.setAttribute('aria-label',`${key} ${shift?slotTitle(key):''} ${name} 일정 ${events.length}개`);button.append(text('span',String(date.getUTCDate()),'day-number'));const lunar=display.showLunar?lunarLabel(key):null;if(lunar){button.classList.add('with-lunar');button.append(text('span',lunar,'lunar-date'));button.setAttribute('aria-label',button.getAttribute('aria-label')+' '+lunar);}if(shift){const view=slotView(key);if(view.only)button.append(text('span',view.name,'shift slot-only '+classes[shift]));else{button.append(text('span',view.shift,'shift '+classes[shift]+(view.hidden?' is-hidden':'')));if(view.name)button.append(text('span',view.name,'slot-name'));}}for(const workName of workNamesOn(key).slice(0,2))button.append(text('span',workName.name,'work-name person-'+workName.color.toLowerCase()));if(name)button.append(text('span',name.includes('대체공휴일')?'대체휴일':name.replace('기독탄신일','성탄절').replace('1월 1일','신정'),'holiday-name'));if(events.length)button.append(text('span','일정 '+events.length+'개','event-count'));const annual=events.find(item=>item.kind==='anniversary');if(annual)button.append(text('span',annual.data.title,'anniversary-badge'));const duties=companions.filter(item=>WorkPlan.working(personShift(item,key)));for(const item of duties.slice(0,2))button.append(text('span',item.data.name,'person-badge person-'+item.data.color.toLowerCase()));if(duties.length>2)button.append(text('span','외 '+(duties.length-2)+'명','event-count'));button.setAttribute('aria-label',button.getAttribute('aria-label')+' '+labels.REGULAR+' 아래 이름 '+workNamesOn(key).map(item=>item.name).join(' ')+' 함께 근무 '+duties.map(item=>item.data.name).join(' '));button.onclick=()=>{selected=key;render();};$('grid').append(button);}
for(let i=0;i<42;i++){const date=new Date(first);date.setUTCDate(first.getUTCDate()+i);const key=dateKey(date),shift=shiftOn(key),name=holiday(key),events=eventsOn(key);const button=document.createElement('button');button.type='button';button.className='day'+(key.slice(0,7)!==month?' outside':'')+(key===selected?' selected':'')+(key===today?' current':'')+(date.getUTCDay()===0?' sun':date.getUTCDay()===6?(r&&WorkPlan.regime(r,key).workWeek===5?' sat holiday':' sat'):'')+(name?' holiday':'')+(display.dutyAsWeekday===true&&shift==='DUTY'?' duty-weekday':'')+(display.offAsHoliday===true&&shift==='OFF'?' off-red':'')+(WorkPlan.fullLeave(shift)?' leave-red':shift==='HALF_LEAVE'?' half-blue':'');button.setAttribute('aria-label',`${key} ${shift?slotTitle(key):''} ${name} 일정 ${events.length}개`);button.append(text('span',String(date.getUTCDate()),'day-number'));const lunar=display.showLunar?lunarLabel(key):null;if(lunar){button.classList.add('with-lunar');button.append(text('span',lunar,'lunar-date'));button.setAttribute('aria-label',button.getAttribute('aria-label')+' '+lunar);}if(shift){const view=slotView(key);if(view.only)button.append(text('span',view.name,'shift slot-only '+classes[shift]));else{button.append(text('span',view.shift,'shift '+classes[shift]+(view.hidden?' is-hidden':'')));if(view.name)button.append(text('span',view.name,'slot-name'));}}for(const workName of workNamesOn(key).slice(0,2))button.append(text('span',workName.name,'work-name person-'+workName.color.toLowerCase()));if(name)button.append(text('span',name.includes('대체공휴일')?'대체휴일':name.replace('기독탄신일','성탄절').replace('1월 1일','신정'),'holiday-name'));if(events.length)button.append(text('span','일정 '+events.length+'개','event-count'));const annual=events.find(item=>item.kind==='anniversary');if(annual)button.append(text('span',annual.data.title,'anniversary-badge'));const duties=companions.filter(item=>WorkPlan.working(personShift(item,key)));for(const item of duties.slice(0,2))button.append(text('span',item.data.name,'person-badge person-'+item.data.color.toLowerCase()));if(duties.length>2)button.append(text('span','외 '+(duties.length-2)+'명','event-count'));button.setAttribute('aria-label',button.getAttribute('aria-label')+' '+labels.REGULAR+' 아래 이름 '+workNamesOn(key).map(item=>item.name).join(' ')+' 함께 근무 '+duties.map(item=>item.data.name).join(' '));button.onclick=()=>{selected=key;render();};$('grid').append(button);}
const selectedDay=dayDate(selected);$('selected-date').textContent=new Intl.DateTimeFormat('ko-KR',{month:'long',day:'numeric',weekday:'short',timeZone:'UTC'}).format(selectedDay);$('day-detail').textContent=[slotTitle(selected),holiday(selected)].filter(Boolean).join(' · ')||'등록한 일정을 확인하고 새로 추가하세요.';
$('agenda').replaceChildren();const events=eventsOn(selected);if(!events.length)$('agenda').append(text('div','등록된 일정이 없습니다.\n가벼운 메모부터 시작해 보세요.','empty'));for(const item of events){const node=document.createElement('button');node.className='event-item '+(item.data.category==='PARTTIME'?'parttime':item.data.category==='WORK'?'work':item.data.category==='LEAVE'?'leave':'');node.append(text('strong',item.data.title),text('span',eventTimeSummary(item.data)),text('span',categories[item.data.category]));node.onclick=()=>openEvent(item);$('agenda').append(node);}
$('people-list').replaceChildren();if(!companions.length)$('people-list').append(text('p','이름과 근무 주기를 등록해 함께 볼 수 있습니다.','small'));for(const item of companions){const node=text('button',item.data.name+' · '+labels[personShift(item,selected)],'person-row person-'+item.data.color.toLowerCase());node.append(text('small','주'+(item.data.workWeek||6)+'일제 · '+WorkPlan.regime(item.data,selected).pattern.length+'일 반복 · '+personColors[item.data.color]));if(item.shared)node.append(text('small','소속 공유 · 본인만 수정 가능'));node.onclick=()=>item.shared?openCompany():openPerson(item);$('people-list').append(node);}