Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <TimerCountdown
- initialMilliseconds={1000 * 0}
- onTick={(milliseconds) => console.log("tick", milliseconds)}
- onExpire={() => console.log('hello')}
- formatMilliseconds={(milliseconds) => {
- const remainingSec = Math.round(milliseconds / 1000);
- const seconds = parseInt((remainingSec % 60).toString(), 10);
- const minutes = parseInt(((remainingSec / 60) % 60).toString(), 10);
- const hours = parseInt((remainingSec / 3600).toString(), 10);
- const s = seconds < 10 ? '0' + seconds : seconds;
- const m = minutes < 10 ? '0' + minutes : minutes;
- let h = hours < 10 ? '0' + hours : hours;
- h = h === '00' ? '' : h + ':';
- return s == '00' ? <View>
- <TouchableOpacity onPress={() => this.setState({
- timeCount: 'A'
- })}>
- <Text>Jangkrik</Text>
- </TouchableOpacity>
- </View> : h + m + ':' + s
- }}
- allowFontScaling={true}
- style={styles.textTwo}
- />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement