GitXplorerGitXplorer
j

epiweek

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
109caeba6292294141857dea8d9cd40904286310

Update bazelisk to most recent version

jjmeekhof committed 3 years ago
Unverified
c84fd84527223f9cad0a593ead4adcf320a75625

Update gazelle to most current version

jjmeekhof committed 3 years ago
Unverified
c8546f44a6c9b0b86835b7e494b7ffea35b96130

Update bazel go rules

jjmeekhof committed 3 years ago
Unverified
257bdb5d0723695d386943fa4b63cbc1508eaf98

Store internal time with hour minutes seconds

committed 4 years ago
Unverified
0d204d745faff7e9398d50162fa34a1cb46752fd

Add func for date of beginning of period

committed 4 years ago
Unverified
73ddbed5e939d963f044dc9a5a73ba40eac859d2

Update README for updated api

committed 4 years ago

README

The README file for this repository.

:CI_badge: https://github.com/jmeekhof/epiweek/workflows/CI/badge.svg :CI_link: https://github.com/jmeekhof/epiweek/actions?query=workflow%3ACI :GoDoc_badge: https://godoc.org/github.com/jmeekhof/epiweek?status.svg :GoDoc_link: https://pkg.go.dev/github.com/jmeekhof/epiweek :Cover_badge: https://coveralls.io/repos/github/jmeekhof/epiweek/badge.svg?branch=main :Cover_link: https://coveralls.io/github/jmeekhof/epiweek?branch=main :Codecov_badge: https://codecov.io/gh/jmeekhof/epiweek/branch/main/graph/badge.svg?token=SYPRE0TPMM :Codecov_link: https://codecov.io/gh/jmeekhof/epiweek

= Epiweek Calculator

image:{CI_badge}["Build Status", link="{CI_link}"] image:{GoDoc_badge}["GoDoc Status", link="{GoDoc_link}"] image:{Cover_badge}["Coverage Status", link="{Cover_link}"] image:{Codecov_badge}["Codecov.io Status", link="{Codecov_link}"]

Simple week counter for weeks of the year. Often used in epidemiology. An epiweek is similar to an ISO week, except the epiwook starts on Sunday and ISO week begins on Monday.

== Overview Epidemiological weeks are just a standardized way to count weeks in a year. It's a convenient grouping mechanism that allows for easy comparison in a year over year fashion. The CDC defines an epi week as seven days beginning on Sunday. The end of the week (Saturday for epi week, Sunday for ISO week) must land at least 4 days into the year. Another way to look at is, if the week is mostly in the new year, it goes with the new year.

== Basic Usage [source,go]

package main

import ( "fmt" "time"

"github.com/jmeekhof/epiweek"

)

func main() { days := []epiweek.Epiweek{ epiweek.NewEpiweek(date(2019, 12, 31)), epiweek.NewEpiweek(date(2020, 10, 15)), epiweek.NewEpiweek(date(2020, 10, 16)), epiweek.NewEpiweek(date(2020, 10, 17)), epiweek.NewEpiweek(date(2020, 10, 18)), epiweek.NewEpiweek(date(2020, 10, 19)), epiweek.NewEpiweek(date(2020, 10, 20)), epiweek.NewEpiweek(date(2020, 10, 21)), epiweek.NewEpiweek(date(2020, 10, 22)), }

for _, epi := range days {
	year, week := epi.Epiweek()
	fmt.Print("Year: ", year, " Week: ", week, "\n")
}

}