Skip to content

Commit 684b752

Browse files
committed
Add utilities to README
1 parent 487e7d5 commit 684b752

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ simple example.
3333

3434
### Properties
3535

36-
* `component:String|Function` - Element to render the timecode within. (Default: `span`)
36+
* `as:String|Function` - Element to render the timecode within. (Default: `span`)
3737
* `format:String` - Specifies the format to display the timecode. (Default: `H:?m:ss`)
3838
* `HH:mm:ss.SSS` - (Example: 00:01:23.876)
3939
* `H:mm:ss.SSS` - (Example: 0:01:23.876)
@@ -73,6 +73,17 @@ import Timecode from 'react-timecode';
7373

7474
```
7575

76+
### Utilities
77+
78+
In addition to the `Timecode` component, the underlying utility methods that the
79+
component uses for rendering the timecodes have also been exposed, in case you
80+
have some need to render some strings without the context of the component.
81+
82+
* `parseTime(time:Number): { hours: Number, minutes: Number, seconds: Number, milliseconds: Number }`
83+
* `pad(number: Number, length: Number = 2): String`
84+
* `formatMilliseconds(milliseconds: Number, length: Number = 3)`
85+
* `formatTimecode({ format: String, time: Number }): String`
86+
7687
## Pairs well with...
7788

7889
* [react-timer-wrapper](https://github.com/ryanhefner/react-timer-wrapper)

0 commit comments

Comments
 (0)