Skip to content

Commit

Permalink
v2.3.3 (#212)
Browse files Browse the repository at this point in the history
* Make CountdownProps interface date required

* Bump version number

* Update test-related scripts

* Update test-related scripts

* Update docs

* Update docs

* Deprecate set-output workflow commands

* Deprecate set-output workflow commands
  • Loading branch information
ndresx committed Oct 22, 2022
1 parent 8a31928 commit bab6fe3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
Expand All @@ -68,7 +68,7 @@ jobs:
run: yarn install

- name: "Tests: Unit"
run: yarn test
run: yarn test:coverage

- name: "Tests: E2E"
run: yarn test:e2e
Expand All @@ -93,7 +93,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ import Countdown, { zeroPad, calcTimeDelta, formatTimeDelta } from 'react-countd
```

### `zeroPad(value, [length = 2])`
The `zeroPad` function works similarly to other well-known pad-functions and takes two arguments into account. A `value` which can be a `string` or `number`, as well as a `length` parameter that defaults to `2` as you are most likely only going to use this function if you actually want to pad one of your values. Either returns a `number` if `length` equals `0`, or the zero-padded `string`.
The `zeroPad` function transforms and returns a given `value` with padded zeros depending on the `length`. The `value` can be a `string` or `number`, while the `length` parameter can be a `number`, defaulting to `2`. Returns the zero-padded `string`, e.g., `zeroPad(5)` => `05`.

```js
const renderer = ({ hours, minutes, seconds }) => (
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-countdown",
"version": "2.3.2",
"version": "2.3.3",
"description": "A customizable countdown component for React.",
"main": "./dist/index.js",
"module": "./dist/index.es.js",
Expand Down Expand Up @@ -35,7 +35,8 @@
"lint:tsc": "tsc --noEmit",
"prettier-check": "prettier --list-different ./src/**/*.{ts,tsx}",
"prettier": "prettier --write ./src/**/*.{ts,tsx}",
"test": "jest --coverage",
"test": "jest",
"test:coverage": "jest --coverage",
"test:e2e": "yarn start-server-and-test test:e2e:server http://localhost:1234 \"cypress run\"",
"test:e2e:clean": "rm -rf ./e2e/dist",
"test:e2e:dev": "yarn start-server-and-test test:e2e:server http://localhost:1234 \"cypress open\"",
Expand Down
2 changes: 1 addition & 1 deletion src/Countdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface CountdownProps
extends React.Props<Countdown>,
CountdownTimeDeltaFormatOptions,
Omit<LegacyCountdownProps, 'onComplete'> {
readonly date?: Date | number | string;
readonly date: Date | number | string;
readonly controlled?: boolean;
readonly intervalDelay?: number;
readonly precision?: number;
Expand Down

0 comments on commit bab6fe3

Please sign in to comment.