-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module github.com/kaihendry/days | ||
|
||
go 1.17 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/apex/gateway/v2 v2.0.0 | ||
github.com/apex/log v1.9.0 | ||
) | ||
|
||
require ( | ||
github.com/aws/aws-lambda-go v1.28.0 // indirect | ||
github.com/aws/aws-lambda-go v1.41.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,84 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Days of {{ .Month.Format "January 2006" }}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="icon" href="data:,"> | ||
|
||
<style> | ||
html { | ||
max-width: 38rem; | ||
padding: 2rem; | ||
margin: auto; | ||
line-height: 1.5rem; | ||
font-size: 24px; | ||
} | ||
|
||
body { | ||
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | ||
width: 80%; | ||
body { | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 1rem; | ||
color: #333; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin: auto; | ||
} | ||
li { | ||
list-style-type: none; | ||
|
||
h2 { | ||
color: #4a7c59; | ||
margin: 1rem 0; | ||
font-size: 1.2rem; | ||
} | ||
|
||
p { | ||
margin: 0.25rem 0; | ||
font-size: 1rem; | ||
} | ||
|
||
p strong { | ||
font-weight: bold; | ||
color: #d35400; /* A distinct color for the current day */ | ||
} | ||
|
||
form { | ||
margin-bottom: 1rem; | ||
} | ||
|
||
input[type="month"] { | ||
padding: 0.5rem; | ||
border: 1px solid #ddd; | ||
border-radius: 0.25rem; | ||
font-size: 1rem; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
a { | ||
color: #2a5db0; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
</style> | ||
<title>Days of {{ .Month.Format "January 2006" }}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="icon" href="data:,"> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<input type="month" value='{{ .Month.Format "2006-01" }}' name="month" onchange="this.form.submit()"> | ||
</form> | ||
<ol> | ||
{{range $day := .Days -}} | ||
{{ if eq ($day.Format "2006-01-02") ($.Now.Format "2006-01-02") }} | ||
<li><strong>{{ $day.Format "2006-01-02 Mon" }}</strong></li> | ||
{{ else }} | ||
<li>{{ $day.Format "2006-01-02 Mon" }}</li> | ||
{{ end }} | ||
{{end}} | ||
</ol> | ||
{{ $previousWeek := -1 }} <!-- Initialize a variable to track the previous week number --> | ||
{{range $day := .Days -}} | ||
{{ $currentWeek := $day | weekNumber }} <!-- Get the current week number --> | ||
{{ if ne $currentWeek $previousWeek }} <!-- Compare with the previous week number --> | ||
<h2>Week Number: {{ $currentWeek }}</h2> <!-- Print the week number if it's different --> | ||
{{ $previousWeek = $currentWeek }} <!-- Update the previous week number --> | ||
{{ end }} | ||
|
||
{{ if eq ($day.Format "2006-01-02") ($.Now.Format "2006-01-02") }} | ||
<p><strong>{{ $day.Format "2006-01-02 Mon" }}</strong></p> | ||
{{ else }} | ||
<p>{{ $day.Format "2006-01-02 Mon" }}</p> | ||
{{ end }} | ||
{{end}} | ||
|
||
<br> | ||
<p>Version: {{ .Version }} - <a href="https://github.com/kaihendry/days">Source code</a></p> | ||
</body> | ||
|
||
</html> | ||
</html> |