Skip to content

Commit

Permalink
chore: fix missing codecov token
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Jun 6, 2024
1 parent 3ca80ad commit 1cd2f67
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ jobs:
- name: Test
run: yarn test --coverage && yarn cucumber --tags 'not @draft'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

publish:
runs-on: ubuntu-latest
Expand Down
67 changes: 36 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![codecov](https://codecov.io/github/dhis2/multi-calendar-dates/graph/badge.svg?token=VZBHOLXYP1)](https://codecov.io/github/dhis2/multi-calendar-dates)


# multi-calendar-engine

This library is used to work with dates in multiple calendrical system (i.e.
Expand Down Expand Up @@ -257,10 +256,10 @@ type FixedPeriod = {

- `id` (and `iso`) are the same right now, and return a period identifier,
i.e. `2015Q1` (quarter one of the year 2015) or `2015SunW1` (the first week
- starting Sunday - of the year 2015). The full list of values are
documented in
[periodValues](https://github.com/dhis2/multi-calendar-dates/blob/main/features/fixed-periods.ethiopic.feature)
in the feature files.
- starting Sunday - of the year 2015). The full list of values are
documented in
[periodValues](https://github.com/dhis2/multi-calendar-dates/blob/main/features/fixed-periods.ethiopic.feature)
in the feature files.

> please use `id` to identify the period. `iso` was added for backwards
> compatibility with existing implementations
Expand Down Expand Up @@ -321,27 +320,29 @@ underlying iso8601 (gregory) date.

## `createFixedPeriodFromPeriodId`

* [API](#createFixedPeriodFromPeriodId-api)
* [Examples](#createFixedPeriodFromPeriodId-examples)
- [API](#createFixedPeriodFromPeriodId-api)
- [Examples](#createFixedPeriodFromPeriodId-examples)

<a name="createFixedPeriodFromPeriodId-api"></a>

### API

#### Arguments

The function expects an options object with the following properties:

| Option | type | Required | Default value | Description |
|-|-|-|-|-|
| `periodId` | `string` | yes | - | A period id, e.g. `2020` or `2020April` |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |
| Option | type | Required | Default value | Description |
| ---------- | ------------------- | -------- | ------------- | ---------------------------------------------- |
| `periodId` | `string` | yes | - | A period id, e.g. `2020` or `2020April` |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |

#### Return value

Returns a `FixedPeriod` whos `id` equals the provided `periodId`, see `src/period-calculation/types.ts`

<a name="createFixedPeriodFromPeriodId-examples"></a>

### Examples

```ts
Expand All @@ -367,28 +368,30 @@ will return:
## `getAdjacentFixedPeriods`
* [API](#getAdjacentFixedPeriods-api)
* [Examples](#getAdjacentFixedPeriods-examples)
- [API](#getAdjacentFixedPeriods-api)
- [Examples](#getAdjacentFixedPeriods-examples)
<a name="getAdjacentFixedPeriods-api"></a>
### API
#### Arguments
The function expects an options object with the following properties:
| Option | Type | Required | Default value | Description |
|-|-|-|-|-|
| `period` | `FixedPeriod` | yes | - | A period id, e.g. `2020` or `2020April` |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `steps` | `integer` | no | `1` | Amount of adjacent fixed period forward/backward, can be negative |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |
| Option | Type | Required | Default value | Description |
| ---------- | ------------------- | -------- | ------------- | ----------------------------------------------------------------- |
| `period` | `FixedPeriod` | yes | - | A period id, e.g. `2020` or `2020April` |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `steps` | `integer` | no | `1` | Amount of adjacent fixed period forward/backward, can be negative |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |
#### Return value
Returns a collection with fixed periods, see `src/period-calculation/types.ts`
<a name="getAdjacentFixedPeriods-examples"></a>
### Examples
**With `steps: 1` (default):**
Expand Down Expand Up @@ -435,7 +438,7 @@ getAdjacentFixedPeriods({
will return:
```ts
[
;[
{
periodType: 'DAILY',
name: '2022-12-31',
Expand Down Expand Up @@ -474,7 +477,7 @@ getAdjacentFixedPeriods({
will return:
```ts
[
;[
{
periodType: 'DAILY',
name: '2022-12-30',
Expand Down Expand Up @@ -507,29 +510,31 @@ will return:
## `getFixedPeriodByDate`
* [API](#getFixedPeriodByDate-api)
* [Examples](#getFixedPeriodByDate-examples)
- [API](#getFixedPeriodByDate-api)
- [Examples](#getFixedPeriodByDate-examples)
<a name="getFixedPeriodByDate-api"></a>
### API
#### Arguments
The function expects an options object with the following properties:
| Option | Type | Required | Default value | Description |
|-|-|-|-|-|
| `periodType` | `PeriodType` | yes | - | E.g. `'YEARLY'` (see
`src/period-calculation/period-types.ts`) |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `date` | `string` | yes | - | E.g. `'2020-10-04'` |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |
| Option | Type | Required | Default value | Description |
| ----------------------------------------- | ------------------- | -------- | ------------- | ---------------------------------------------- |
| `periodType` | `PeriodType` | yes | - | E.g. `'YEARLY'` (see |
| `src/period-calculation/period-types.ts`) |
| `calendar` | `SupportedCalendar` | yes | - | A calendar sytem, e.g. `gregory` or `ethiopic` |
| `date` | `string` | yes | - | E.g. `'2020-10-04'` |
| `locale` | `string` | no | `"en"` | A language locale for the displayed labels |
#### Return value
Returns a fixed period, see `src/period-calculation/types.ts`
<a name="getFixedPeriodByDate-examples"></a>
### Examples
```ts
Expand Down

0 comments on commit 1cd2f67

Please sign in to comment.