Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ract native hour input

import React, { Component } from "react";
import { StyleSheet, View, TouchableOpacity, Text } from "react-native";
import TimePicker from "react-native-24h-timepicker";
 
class Example extends Component {
  constructor() {
    super();
    this.state = {
      time: ""
    };
  }
 
  onCancel() {
    this.TimePicker.close();
  }
 
  onConfirm(hour, minute) {
    this.setState({ time: `${hour}:${minute}` });
    this.TimePicker.close();
  }
 
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.text}>REACT NATIVE</Text>
        <Text style={styles.text}>24 HOURS FORMAT TIMEPICKER</Text>
        <TouchableOpacity
          onPress={() => this.TimePicker.open()}
          style={styles.button}
        >
          <Text style={styles.buttonText}>TIMEPICKER</Text>
        </TouchableOpacity>
        <Text style={styles.text}>{this.state.time}</Text>
        <TimePicker
          ref={ref => {
            this.TimePicker = ref;
          }}
          onCancel={() => this.onCancel()}
          onConfirm={(hour, minute) => this.onConfirm(hour, minute)}
        />
      </View>
    );
  }
}
 
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    backgroundColor: "#fff",
    paddingTop: 100
  },
  text: {
    fontSize: 20,
    marginTop: 10
  },
  button: {
    backgroundColor: "#4EB151",
    paddingVertical: 11,
    paddingHorizontal: 17,
    borderRadius: 3,
    marginVertical: 50
  },
  buttonText: {
    color: "#FFFFFF",
    fontSize: 16,
    fontWeight: "600"
  }
});
 
export default Example;
Comment

ract native hour input

import React, { Component } from "react";
import { StyleSheet, View, TouchableOpacity, Text } from "react-native";
import TimePicker from "react-native-24h-timepicker";
 
class Example extends Component {
  constructor() {
    super();
    this.state = {
      time: ""
    };
  }
 
  onCancel() {
    this.TimePicker.close();
  }
 
  onConfirm(hour, minute) {
    this.setState({ time: `${hour}:${minute}` });
    this.TimePicker.close();
  }
 
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.text}>REACT NATIVE</Text>
        <Text style={styles.text}>24 HOURS FORMAT TIMEPICKER</Text>
        <TouchableOpacity
          onPress={() => this.TimePicker.open()}
          style={styles.button}
        >
          <Text style={styles.buttonText}>TIMEPICKER</Text>
        </TouchableOpacity>
        <Text style={styles.text}>{this.state.time}</Text>
        <TimePicker
          ref={ref => {
            this.TimePicker = ref;
          }}
          onCancel={() => this.onCancel()}
          onConfirm={(hour, minute) => this.onConfirm(hour, minute)}
        />
      </View>
    );
  }
}
 
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    backgroundColor: "#fff",
    paddingTop: 100
  },
  text: {
    fontSize: 20,
    marginTop: 10
  },
  button: {
    backgroundColor: "#4EB151",
    paddingVertical: 11,
    paddingHorizontal: 17,
    borderRadius: 3,
    marginVertical: 50
  },
  buttonText: {
    color: "#FFFFFF",
    fontSize: 16,
    fontWeight: "600"
  }
});
 
export default Example;
Comment

PREVIOUS NEXT
Code Example
Javascript :: p5 colored line 
Javascript :: add content in textarea by clicking on button 
Javascript :: tictactoe using Jquery 
Javascript :: how to get data from jsonplaceholder 
Javascript :: javascript unique id 
Javascript :: sequlize where clause involving associated relationship 
Javascript :: online python to c++ converter 
Javascript :: break object pair into array in js 
Javascript :: uniqSort 
Javascript :: tictactoe - javascript 
Javascript :: Replacing Specific word from url, replacing url 
Javascript :: helperbird 
Javascript :: js import 
Javascript :: moment js get dd/mm/yyyy 
Javascript :: forward slash in ajax url 
Javascript :: index javascript array 
Javascript :: Cannot resolve name `object`.Flow 
Javascript :: lement.style { } 
Javascript :: anonymous functions 
Javascript :: errorhandler npm 
Javascript :: get current user moralis web3 login 
Javascript :: how to trigger a function after stop writing in input text jquery event 
Javascript :: discord.js v12 to v13 
Javascript :: koa get post body 
Javascript :: Here is an example of loading a series of middleware functions at a mount point, with a mount path. It illustrates a middleware sub-stack that prints request info for any type of HTTP request to the /user/:id path. 
Javascript :: how to display value in input field using innerText in js 
Javascript :: typeorm caching queries 
Javascript :: extra reducer 
Javascript :: verify number of times request was made in cypress 
Javascript :: Promisify with ajax call 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =