Skip to content

Commit a2a57b4

Browse files
authored
Merge pull request #37 from Lewiscowles1986/feature/display-notification-time
Display notification expectated time in Listing
2 parents 720da29 + 73f3e28 commit a2a57b4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/appoinment.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('appointment', function() {
1212
appointment = new Appointment({
1313
name: 'Appointment',
1414
phoneNumber: '+5555555',
15-
time: new Date(),
15+
time: '2016-02-17 12:00:00',
1616
notification: 15,
1717
timeZone: 'Africa/Algiers',
1818
});
@@ -27,7 +27,8 @@ describe('appointment', function() {
2727
.expect(function(response) {
2828
expect(response.text).to.contain('Appointment');
2929
expect(response.text).to.contain('+5555555');
30-
expect(response.text).to.contain('15');
30+
expect(response.text).to.contain('2016-02-17 12:00pm');
31+
expect(response.text).to.contain('2016-02-17 11:45am');
3132
expect(response.text).to.contain('Africa/Algiers');
3233
})
3334
.expect(200, done);

views/appointments/index.pug

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ block content
77
th Name
88
th Phone Number
99
th Appointment time (UTC)
10-
th Notification Time (minutes)
10+
th Notification time (UTC)
1111
th Time Zone
1212
th Actions
1313
th
@@ -16,8 +16,8 @@ block content
1616
tr
1717
td !{appointment.name}
1818
td !{appointment.phoneNumber}
19-
td !{appointment.time}
20-
td !{appointment.notification}
19+
td #{moment(appointment.time).format('YYYY-MM-DD hh:mma')}
20+
td #{moment(appointment.time).subtract(appointment.notification, 'minutes').format('YYYY-MM-DD hh:mma')}
2121
td !{appointment.timeZone}
2222
td
2323
a.btn.btn-default.btn-sm(href="/appointments/" + appointment.id + "/edit") Edit

0 commit comments

Comments
 (0)