feat: Update week day representation and add localization support for weekdays

This commit is contained in:
2025-12-14 03:14:58 +09:00
parent 4d3bb6cfd8
commit 575d1a7008
4 changed files with 33 additions and 6 deletions
+6 -6
View File
@@ -78,7 +78,7 @@ const STRATEGIES: StrategyOption[] = [
}
];
const WEEK_DAYS = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
const WEEK_DAY_INDEXES = [0, 1, 2, 3, 4, 5, 6];
// Color Theme Variables for Mapping Editors
const MAPPING_THEME = {
@@ -818,12 +818,12 @@ const StrategySelector: React.FC<StrategySelectorProps> = ({
{/* Middle Row: Full Width Capsules */}
<div className={`grid grid-cols-7 w-full transition-opacity duration-200 mb-3 ${localSchedule.mode !== ScheduleMode.WEEKLY ? 'opacity-50 pointer-events-none' : ''}`}>
{WEEK_DAYS.map((day, index) => {
const isSelected = localSchedule.weeklyDays.includes(index);
{WEEK_DAY_INDEXES.map((dayIndex) => {
const isSelected = localSchedule.weeklyDays.includes(dayIndex);
return (
<button
key={index}
onClick={() => toggleWeekDay(index)}
key={dayIndex}
onClick={() => toggleWeekDay(dayIndex)}
className={`h-9 text-xs font-bold border-y border-l last:border-r border-gray-600/50 transition-colors
first:rounded-l-lg last:rounded-r-lg
${isSelected
@@ -832,7 +832,7 @@ const StrategySelector: React.FC<StrategySelectorProps> = ({
}
`}
>
{day}
{t(`schedule.weekdaysNarrow.${dayIndex}`)}
</button>
)
})}