Skip to content

Commit

Permalink
Remove seconds from the time format: Issue #99
Browse files Browse the repository at this point in the history
  • Loading branch information
heldersepu committed May 3, 2020
1 parent 3a4d26c commit 1f00438
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
94 changes: 47 additions & 47 deletions src/MapContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class MapContainer extends Component {
showCheckDirections: false,
showSaveToCSV: false,
showInstructions: false

};

this.postData = this.postData.bind(this);
Expand Down Expand Up @@ -254,7 +254,7 @@ export class MapContainer extends Component {
let row = {};
row.case_id = this.props.patientId;
row.date = obj.date;
row.time = moment(obj.time).format('hh:mm:ss A');
row.time = moment(obj.time).format('hh:mm A');
row.latitude = obj.lat;
row.longitude = obj.lng;

Expand Down Expand Up @@ -284,19 +284,19 @@ export class MapContainer extends Component {

displayDirectionsAndDateSearch = () => {
if (this.state.showCheckDirections === true) {
return (
<>
<Collapse>
<Panel key="2" header="Direction Search">
<DirectionSearch></DirectionSearch>
</Panel>
<Panel key="3" header="Date range Search">
<DaterangeSearch></DaterangeSearch>
</Panel>
</Collapse>
</>

)
return (
<>
<Collapse>
<Panel key="2" header="Direction Search">
<DirectionSearch></DirectionSearch>
</Panel>
<Panel key="3" header="Date range Search">
<DaterangeSearch></DaterangeSearch>
</Panel>
</Collapse>
</>

)
} else {

}
Expand Down Expand Up @@ -338,40 +338,40 @@ export class MapContainer extends Component {
const steps =
window.innerWidth > 919
? [
{
element: '.outer-wrap',
intro:
'Click on the map and pick a date and time and click Save Footprint to record a footprint. Click on individual markers on the map if you want to edit them. View the table on the right to see your full timeline.',
position: 'right',
},
{
element: '.data',
intro:
'As you save footprints you will see them update in this table. If you need to delete any click on the red trash can beside the footprint you need to delete.',
},
{
element: '.save-button',
intro:
'When you have finished entering in your footprints, click this button to complete the process. ',
},
]
{
element: '.outer-wrap',
intro:
'Click on the map and pick a date and time and click Save Footprint to record a footprint. Click on individual markers on the map if you want to edit them. View the table on the right to see your full timeline.',
position: 'right',
},
{
element: '.data',
intro:
'As you save footprints you will see them update in this table. If you need to delete any click on the red trash can beside the footprint you need to delete.',
},
{
element: '.save-button',
intro:
'When you have finished entering in your footprints, click this button to complete the process. ',
},
]
: [
{
element: '.outer-wrap',
intro:
'Click on the map and pick a date and time to record a footprint. Click on individual markers on the map if you want to edit them.',
position: 'right',
},
{
element: '.burger',
intro:
'Click on this button to open up the table that displays all your footprints and press Save and Exit to anonymously save your timeline. ',
},
];
{
element: '.outer-wrap',
intro:
'Click on the map and pick a date and time to record a footprint. Click on individual markers on the map if you want to edit them.',
position: 'right',
},
{
element: '.burger',
intro:
'Click on this button to open up the table that displays all your footprints and press Save and Exit to anonymously save your timeline. ',
},
];
// format datasource for rendering table (datasource is an arr of objects)
const dataSource = this.state.footPrints.map((footprint, idx) => {
const formattedDate = moment(footprint.date).format('ddd, ll'); // Thu, Mar 26, 2020 format
const formattedTime = moment(footprint.time).format('hh:mm:ss A'); // 08:05:46 PM format
const formattedTime = moment(footprint.time).format('hh:mm A'); // 08:05:46 PM format
return {
key: idx,
patient_id: this.state.patientId,
Expand Down Expand Up @@ -452,7 +452,7 @@ export class MapContainer extends Component {

</ol>
</Panel>

</Collapse>
{this.displayDirectionsAndDateSearch()}

Expand All @@ -464,7 +464,7 @@ export class MapContainer extends Component {
size="small"
/>


<div>
<button className="save-button" onClick={this.postData}>
{this.showWhatButtonText()}
Expand Down
10 changes: 5 additions & 5 deletions src/components/DateTimePickerModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const DateTimePickerModal = (props) => {
editMode ? (
''
) : (
<Button key="delete" type="danger" onClick={onDelete}>
Delete
</Button>
),
<Button key="delete" type="danger" onClick={onDelete}>
Delete
</Button>
),
<Button key="back" onClick={onCancel}>
Cancel
</Button>,
Expand All @@ -46,7 +46,7 @@ const DateTimePickerModal = (props) => {
onChange={onDateChange}
disabledDate={disabledFutureDate}
/>
<TimePicker value={time} onChange={onTimeChange} />
<TimePicker value={time} onChange={onTimeChange} format='HH:mm' />
</Modal>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/UserFacing/UserMapContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class UserMapContainer extends Component {
let row = {};
row.case_id = this.props.patientId;
row.date = obj.date;
row.time = moment(obj.time).format('hh:mm:ss A');
row.time = moment(obj.time).format('hh:mm A');
row.latitude = obj.lat;
row.longitude = obj.lng;

Expand Down Expand Up @@ -331,7 +331,7 @@ export class UserMapContainer extends Component {
// format datasource for rendering table (datasource is an arr of objects)
const dataSource = this.state.footPrints.map((footprint, idx) => {
const formattedDate = moment(footprint.date).format('ddd, ll'); // Thu, Mar 26, 2020 format
const formattedTime = moment(footprint.time).format('hh:mm:ss A'); // 08:05:46 PM format
const formattedTime = moment(footprint.time).format('hh:mm A'); // 08:05:46 PM format
return {
key: idx,
patient_id: this.state.patientId,
Expand Down Expand Up @@ -420,7 +420,7 @@ export class UserMapContainer extends Component {
size="small"
/>


<div className="checkfootprint-holder">
<button className="save-button" onClick={this.postData}>
{this.showWhatButtonText()}
Expand Down

0 comments on commit 1f00438

Please sign in to comment.