Skip to content

Commit

Permalink
remove hover styles from disallowed dates
Browse files Browse the repository at this point in the history
  • Loading branch information
WickyNilliams committed May 10, 2024
1 parent b944b35 commit f0d8d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cally dev</title>

<script async type="module" src="./src/index.ts"></script>

<style>
* {
box-sizing: border-box;
Expand Down Expand Up @@ -88,17 +86,17 @@ <h2>date</h2>
</div>
</calendar-date>

<script>
<script type="module">
import "./src/index.ts";

const output = document.getElementById("output");
const formatter = new Intl.DateTimeFormat("en", {
year: "numeric",
month: "long",
day: "numeric",
});

function toIso(date) {
return date.toISOString().split("T")[0];
}
const toIso = (date) => date.toISOString().split("T")[0];

if (window.range) {
let start = null;
Expand All @@ -116,6 +114,9 @@ <h2>date</h2>
}

if (window.date) {
date.isDateDisallowed = (date) =>
date.getDay() === 0 || date.getDay() === 6;

yearSelect.value = new Date(
date.getAttribute("value")
).getUTCFullYear();
Expand Down
2 changes: 1 addition & 1 deletion src/calendar-month/calendar-month.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const CalendarMonth = c(
inline-size: 2.25rem;
}
button:hover:where(:not(:disabled)) {
button:hover:where(:not(:disabled, [aria-disabled])) {
background: #0000000d;
}
Expand Down

0 comments on commit f0d8d6d

Please sign in to comment.