당직근무 0.15.2 (웹 2026-11-25.6): 근무 순서 이름 줄에서 (-1) 표시 빼기

사용자가 다음 당직 전날에 붙던 (-1)이 헷갈린다고 해서 +1 · 비번, +2 · 일반근무처럼 숫자만 보이게 했다.
앱 0.15.2 / 설치 번호 26. APK 876070바이트, SHA-256 95f1883eb56ede45fa34618d15d7e46d6c6474492c083248a14edf2632f61e57
This commit is contained in:
블리어 committed 2026-11-25 02:22:53 +00:00
1 parent f77bb94bee
commit 5574172a1a
14 files changed
+30 -27

No files matched your search

+2 -2
View File
@@ -14,8 +14,8 @@ function applyShiftNames(){const name=cleanRegularName(displaySettings().regular
function slotView(key){const r=rotation(),display=displaySettings(),shift=shiftOn(key);if(!shift)return {shift:'',name:'',shiftKey:null,hidden:false};const name=r?WorkPlan.nameOn(r,key):'',mode=display.nameDisplay||'both',label=shift==='REGULAR'?regularShort:labels[shift],hidden=shift==='REGULAR'&&display.hideRegular===true;
if(name&&mode==='name')return {shift:'',name,shiftKey:shift,hidden:false,only:true};return {shift:label,name:name&&mode==='both'?name:'',shiftKey:shift,hidden};}
function slotTitle(key){const shift=shiftOn(key);if(!shift)return '';const r=rotation(),name=r?WorkPlan.nameOn(r,key):'',mode=displaySettings().nameDisplay||'both';return name&&mode!=='shift'?labels[shift]+'('+name+')':labels[shift];}
// 근무 순서 이름 창의 줄 이름: 내 당직 기준 +1 · 비번, +2 · 일반근무(-1). 앱 ShiftNames.relativeLabel과 같다.
function relativeLabel(pattern,index){const size=pattern.length,title=labels[pattern[index]];if(!pattern.includes('DUTY'))return (index+1)+'일째 · '+title;let after=1;while(pattern[((index-after)%size+size)%size]!=='DUTY')after++;let before=1;while(pattern[(index+before)%size]!=='DUTY')before++;return '+'+after+' · '+title+(before===1?'(-1)':'');}
// 근무 순서 이름 창의 줄 이름: 내 당직 기준 +1 · 비번, +2 · 일반근무. 다음 당직 전날의 (-1)은 헷갈려서 넣지 않는다. 앱 ShiftNames.relativeLabel과 같다.
function relativeLabel(pattern,index){const size=pattern.length,title=labels[pattern[index]];if(!pattern.includes('DUTY'))return (index+1)+'일째 · '+title;let after=1;while(pattern[((index-after)%size+size)%size]!=='DUTY')after++;return '+'+after+' · '+title;}
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]);}