Skip to content

Commit

Permalink
add task log migration for period changes
Browse files Browse the repository at this point in the history
  • Loading branch information
faaydemir committed Aug 20, 2023
1 parent 10d37a8 commit 17d3453
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ https://faaydemir.github.io/routinize
- notification
- implement delete me
## issues
- monyhly view extend small screen
- monyhly view extend at small screen
- after task added form is not cleaned
21 changes: 11 additions & 10 deletions src/model/period-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ export default class PeriodLog {
// get time units for task period
const units = getTimeUnitsInRange(task.period || TIME_PERIODS.DAY, startDate, endDate);
units.forEach(unit => {
const log = logs[unit.id]
? logs[unit.id]
: DateLog.create({
taskId: task.id,
progressType: task.progressType,
unit,
stepCount: task.stepCount,
subTasks: task.subtasks
});

const log = DateLog.create({
taskId: task.id,
progressType: task.progressType,
unit,
stepCount: task.stepCount,
subTasks: task.subtasks
});
//TODO move to DateLog class
if (logs[unit.id]) {
log.progress = logs[unit.id].progress
}
log.isLocked = !task.isActiveInDateRange(unit.start, unit.end)
activity.logs.push(log);

Expand Down
3 changes: 2 additions & 1 deletion src/view/page/home/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { detailedTaskLogOpened, logProgressed, taskLoggingCanceled } from "state
import JustDate from "utils/just-date";

const _loadCalendar = async ({ startOfCalendar = undefined, calendarPeriod }) => {
if (!calendarPeriod) {

if (!calendarPeriod) {
calendarPeriod = localStorage.getItem("calendarPeriod");
calendarPeriodChanged(calendarPeriod);
}
Expand Down

0 comments on commit 17d3453

Please sign in to comment.