Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rwu823 committed Dec 25, 2017
2 parents fe59bdf + 9b0e356 commit 3964f0f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ You can omit `HH:mm:ss`, dad will help you auto suffix `00`.
## Regions
Current works regions for event:

`tw`, `ja` and `indo`

> The time zone of HK is same as TW
`tw`, `hk`, `ja` and `indo`

## API

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@17media/dad",
"version": "1.0.1",
"version": "1.1.0",
"repository": "https://github.com/17media/dad.git",
"author": "Rocky Wu <rocky@17.media>",
"main": "dist/dad.js",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export { isToday } from './libs/isToday';
export { now } from './libs/now';

export const tw = (...args) => dad(...args).tw;
export const hk = (...args) => dad(...args).hk;
export const ja = (...args) => dad(...args).ja;
export const indo = (...args) => dad(...args).indo;
4 changes: 4 additions & 0 deletions src/libs/Dad.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default class Dad {
return getTime(new Date(`${suffix00(p.date)}+08:00`));
}

get hk() {
return this.tw;
}

get indo() {
const p = wm.get(this);

Expand Down
8 changes: 7 additions & 1 deletion src/libs/__tests__/Dad.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dad, { tw, ja, indo } from '../../';
import dad, { tw, hk, ja, indo } from '../../';

describe('Dad functionality', () => {
it('return time in ms where time zone is +8:00', () => {
Expand All @@ -8,6 +8,12 @@ describe('Dad functionality', () => {

expect(tw('2017-12-13'))
.toBe(datetime);

expect(dad('2017-12-13').hk)
.toBe(datetime);

expect(hk('2017-12-13'))
.toBe(datetime);
});

it('return time in ms where time zone is +9:00', () => {
Expand Down

0 comments on commit 3964f0f

Please sign in to comment.