Commit c0fec4a5 authored by EKSAD's avatar EKSAD

item laporan

parent eaf8314e
import React, { Component } from 'react'; import React, { Component } from 'react';
import { TextField, Typography } from '@material-ui/core'; import { TextField, Typography } from '@material-ui/core';
import { DatePicker } from '@material-ui/pickers';
const companies = [ const companies = [
{ {
...@@ -62,12 +63,34 @@ const companies = [ ...@@ -62,12 +63,34 @@ const companies = [
]; ];
export default class CreateItemLaporan extends Component { export default class CreateItemLaporan extends Component {
constructor(props) {
super(props)
this.state = {
startDate: new Date(),
endDate: new Date(),
}
}
handleStartDate = (date) => {
this.setState({
startDate: date
});
};
handleEndDate = (date) => {
this.setState({
endDate: date
});
};
componentDidMount() { componentDidMount() {
console.log(this.props.data); console.log(this.props.data);
} }
render() { render() {
const { startDate, endDate } = this.state;
return ( return (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
...@@ -269,33 +292,39 @@ export default class CreateItemLaporan extends Component { ...@@ -269,33 +292,39 @@ export default class CreateItemLaporan extends Component {
}} }}
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <DatePicker
style={{ width: '100%' }} margin="normal"
id="startDate" id="startDate"
value={startDate}
onChange={this.handleStartDate}
label="Berlaku Mulai" label="Berlaku Mulai"
// value={this.props.data.business_unit_name} format="dd MMMM yyyy"
KeyboardButtonProps={{
'aria-label': 'change date',
}}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
paddingLeft: 10 paddingLeft: 10
} }
}} }}
InputLabelProps={{ InputLabelProps={{
style: { style: {
fontSize: 11, fontSize: 11,
color: '#7e8085',
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
paddingLeft: 10 paddingLeft: 10
} }
}} }}
>
</TextField> style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div> </div>
<div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
value="Aktif" value="Aktif"
...@@ -512,28 +541,36 @@ export default class CreateItemLaporan extends Component { ...@@ -512,28 +541,36 @@ export default class CreateItemLaporan extends Component {
/> />
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <DatePicker
style={{ width: '100%' }} margin="normal"
id="unit" id="endDate"
value={endDate}
onChange={this.handleEndDate}
label="Berlaku Hingga" label="Berlaku Hingga"
// defaultValue={"31 Desember 2100"} format="dd MMMM yyyy"
KeyboardButtonProps={{
'aria-label': 'change date',
}}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif' fontFamily: 'Nunito Sans, sans-serif',
paddingLeft: 10
} }
}} }}
InputLabelProps={{ InputLabelProps={{
style: { style: {
fontSize: 11, fontSize: 11,
color: '#7e8085',
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085' paddingLeft: 10
} }
}} }}
>
</TextField> style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment