Skip to content

Commit

Permalink
updated jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed May 27, 2024
1 parent e50e30e commit da02c5c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Returns the day of the year.
* @param date - Date object.
* @param startAtZero - Whether the day of the year should be zero-based.
* @returns Day of year,
*/
export function getDayOfYear(date: Date, startAtZero = false): number {
const year = date.getFullYear()

Expand All @@ -13,8 +19,8 @@ export function getDayOfYear(date: Date, startAtZero = false): number {
/**
* Returns a date string in the modern Julian format. (i.e. YYYYDDD)
* ex. 2023-01-01 => '2023001'
* @param date
* @returns date string in modern Julian format
* @param date - Date object.
* @returns Date string in modern Julian format
*/
export function toModernJulianDate(date: Date): string {
const dayOfYear = getDayOfYear(date)
Expand All @@ -24,8 +30,8 @@ export function toModernJulianDate(date: Date): string {
/**
* Returns a date string in the modern Julian format with a two-digit year. (i.e. YYDDD)
* ex. 2023-01-01 => '23001'
* @param date
* @returns date string in modern Julian format with a two-digit year
* @param date - Date object.
* @returns Date string in modern Julian format with a two-digit year
*/
export function toShortModernJulianDate(date: Date): string {
return toModernJulianDate(date).slice(2)
Expand Down

0 comments on commit da02c5c

Please sign in to comment.