Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
aman-webdev committed Jul 16, 2022
1 parent 27570b1 commit 5102d55
Showing 5 changed files with 1,448 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1,473 changes: 1,432 additions & 41 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
"react-scripts": "5.0.0",
"react-spinners": "^0.11.0",
"react-toastify": "^8.2.0",
"readme-md-generator": "^1.0.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4"
3 changes: 2 additions & 1 deletion client/src/components/CheckBox/Checkbox.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import { tickHabit } from "../../actions/habits";
import moment from "moment";

const Checkbox = ({ value, date, id, notify, dates }) => {
console.log(date);
const dispatch = useDispatch();
const [isChecked, setIsChecked] = useState(false);

@@ -85,7 +86,7 @@ const Checkbox = ({ value, date, id, notify, dates }) => {
</svg>
)}
<p className="text-xs text-[#fff] opacity-70 my-2 w-full">
{moment(date).format("ll")}
{moment(date, "MM/DD/YYYY").format("ll")}
</p>
</button>
);
22 changes: 12 additions & 10 deletions client/src/components/Habit/Habit.js
Original file line number Diff line number Diff line change
@@ -78,16 +78,18 @@ const Habit = ({ habit, index }) => {
</svg>
</div>
<div className="flex w-full flex-wrap mt-6 gap-3 justify-center items-center cursor-pointer">
{habit.habitFrequency.map((freq, i) => (
<CheckBox
name={i}
value={freq}
date={getDaysInWeek()[i].date}
id={habit._id}
notify={notify}
dates={habit.dates}
/>
))}
{habit.habitFrequency.map((freq, i) => {
return (
<CheckBox
name={i}
value={freq}
date={getDaysInWeek()[i].date}
id={habit._id}
notify={notify}
dates={habit.dates}
/>
);
})}
</div>

<ToastContainer

0 comments on commit 5102d55

Please sign in to comment.