/pyjs/tests/test015.js
JavaScript | 26 lines | 26 code | 0 blank | 0 comment | 7 complexity | c09b88b2a5bd6c413134a5a4cb809584 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
- __TimeSlot.prototype.__class__ = "TimeSlot";
- function TimeSlot(dayOfWeek, startMinutes, endMinutes) {
- return new __TimeSlot(dayOfWeek, startMinutes, endMinutes);
- }
- function __TimeSlot(dayOfWeek, startMinutes, endMinutes) {
- this.dayOfWeek = dayOfWeek;
- this.startMinutes = startMinutes;
- this.endMinutes = endMinutes;
- }
- __TimeSlot.prototype.compareTo = function(other) {
- if ((this.dayOfWeek < other.dayOfWeek)) {
- return -1;
- }
- else if ((this.dayOfWeek > other.dayOfWeek)) {
- return 1;
- }
- else {
- if ((this.startMinutes < other.startMinutes)) {
- return -1;
- }
- else if ((this.startMinutes > other.startMinutes)) {
- return 1;
- }
- }
- return 0;
- };