Skip to content

Instantly share code, notes, and snippets.

@khanof89
Created June 22, 2018 05:12
Show Gist options
  • Save khanof89/2aaa02227d7b808b1ce31868e52ef5fd to your computer and use it in GitHub Desktop.
Save khanof89/2aaa02227d7b808b1ce31868e52ef5fd to your computer and use it in GitHub Desktop.
const table = (props) => {
return (
<table className="customeTable tableInventory">
<TableHead/>
<tbody className="admin-list-table-body">
{props.dayNames.map((index, value) => {
return (<tr className="rowClickable" key={value}>
<th className="table_head" key={value}>{moment().format('YYYY-MM-DD') === index ? 'Today' : moment(index).format('dddd')}</th>
{[...Array(24).keys()].map((i) => {
return (<td className="tableCells" key={i}>
<input type="text" className="inputBox" value={(props.availabilities) ? props.availabilities[i] : '0'} onChange={e =>props.textInput(e)} data-id={index+'_'+i} defaultValue="0"/>
</td>);
})}
</tr>);
})}
</tbody>
</table>
);
};
const table = (props) => {
return (
<table className="customeTable tableInventory">
<TableHead/>
<tbody className="admin-list-table-body">
{props.dayNames.map((index, value) => {
return (<tr className="rowClickable" key={value}>
<th className="table_head" key={value}>{moment().format('YYYY-MM-DD') === index ? 'Today' : moment(index).format('dddd')}</th>
{[...Array(24).keys()].map((i) => {
{[...Array(7).keys()].map((j) => {
return (<td className="tableCells" key={i}>
<input type="text" className="inputBox" value={(props.availabilities) ? props.availabilities[i] : '0'} onChange={e =>props.textInput(e)} data-id={index+'_'+i} defaultValue="0"/>
</td>);
})}
})}
</tr>);
})}
</tbody>
</table>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment