Skip to content

Commit

Permalink
Merge pull request #56 from totono/develop
Browse files Browse the repository at this point in the history
release 5.0
  • Loading branch information
totono authored Apr 18, 2023
2 parents c2dfc48 + 19f210f commit 4b72def
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "todo"
version = "0.4.3"
version = "0.5.0"
description = "todo"
authors = ["totono"]
license = ""
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "todo",
"version": "0.4.3"
"version": "0.5.0"
},
"tauri": {
"systemTray": {
Expand Down
26 changes: 24 additions & 2 deletions src/components/elements/layouts/taskItem/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { InputState } from "../../Input/InputState";
import { Content } from "./Content";
import { Header } from "./Header";
import { listItemStyle } from "./rowStyle";
import dayjs from "dayjs";

const { Panel } = Collapse;

Expand Down Expand Up @@ -40,11 +41,32 @@ export const Row = ({ task, setFetch }: rowProps) => {
}))(task);
const [taskState, setTaskState] = useState(state);

// check task is overdue
const activeId = () => {
if (taskState.limit_date === undefined
|| taskState.is_completed === "Yes"
|| taskState.is_deleted === "Yes") {
return undefined;
}
let time = taskState.limit_time;
if (time === undefined) {
time = "23:59";
}
const today = dayjs();
const limit = dayjs(taskState.limit_date + " " + time);
if (today.isAfter(limit)) {
return taskState.id;
} else {
undefined
};
};


return (
<li css={listItemStyle(state)}>
<Collapse>
<Collapse activeKey={activeId()}>
<Panel
key="taskHeader"
key={taskState.id}
collapsible={"icon"}
showArrow={!isEditing}
header={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ return (
const isFuture = (task:InputState) => {
if (task.limit_date == undefined) {return "No"}

let time = ""
if (task.limit_time == undefined) { time = "23:59"}
let time = task.limit_time;
if (task.limit_time == undefined) { time = "23:59"};
const now = dayjs();
const limit = dayjs(task.limit_date +" "+ time);
if (now.isBefore(limit)){
Expand Down

0 comments on commit 4b72def

Please sign in to comment.