Added api for custom timetable events
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension IsSameDay on DateTime {
|
||||
bool isSameDay(DateTime other) {
|
||||
return year == other.year && month == other.month && day == other.day;
|
||||
@ -6,4 +8,12 @@ extension IsSameDay on DateTime {
|
||||
DateTime nextWeekday(int day) {
|
||||
return add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
|
||||
}
|
||||
|
||||
DateTime withTime(TimeOfDay time) {
|
||||
return copyWith(hour: time.hour, minute: time.minute);
|
||||
}
|
||||
|
||||
TimeOfDay toTimeOfDay() {
|
||||
return TimeOfDay(hour: hour, minute: minute);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user