Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/app/DateComponent/DateComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ class SimpleInputGroups extends React.Component<myProps, myState> {
};
}

formatDate(date) {
var d = new Date(date);
var month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();

if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;

return [year, month, day].join('-');
}

updateDateValue(newDate) {
this.setState({ currentDate: newDate });
Expand All @@ -54,7 +41,7 @@ class SimpleInputGroups extends React.Component<myProps, myState> {
type="date"
aria-label="Input Date"
onChange={value => { this.props.changeDate(value); this.updateDateValue(value) }}
value={this.formatDate(this.state.currentDate)}
value={this.state.currentDate}
/>

<InputGroupText component="label" htmlFor="textInput9">
Expand Down
3 changes: 2 additions & 1 deletion src/app/Reports/ReportsDataFilterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ReportsDataFilterForm extends React.Component<myProps, myState> {
constructor(myProps) {
super(myProps);

// Set api as 'https://ssmt.redhat.com/namespace_cpu_request' if ssl certificate is set up.
this.state = {
startDate: new Date(),
conditionalRender: 0,
Expand Down Expand Up @@ -89,7 +90,7 @@ class ReportsDataFilterForm extends React.Component<myProps, myState> {

setDate = (date: Date) => {
date = new Date(date);
date.setDate(date.getDate() + 1);
date.setDate(date.getDate());
this.setState({ ...this.state, changingDate: true, startDate: new Date(date) });
};

Expand Down