Skip to content

Commit

Permalink
Fixed extensions formatting 120 line width
Browse files Browse the repository at this point in the history
  • Loading branch information
FELIPE EDUARDO MORSCHEL committed May 23, 2022
1 parent c94d374 commit 23ec82b
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions lib/src/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,30 +206,24 @@ extension DateTimeTimeExtension on DateTime {
}

/// Returns the Monday of this week
DateTime get firstDayOfWeek => isUtc
? DateTime.utc(year, month, day + 1 - weekday)
: DateTime(year, month, day + 1 - weekday);
DateTime get firstDayOfWeek =>
isUtc ? DateTime.utc(year, month, day + 1 - weekday) : DateTime(year, month, day + 1 - weekday);

/// Returns the Sunday of this week
DateTime get lastDayOfWeek => isUtc
? DateTime.utc(year, month, day + 7 - weekday)
: DateTime(year, month, day + 7 - weekday);
DateTime get lastDayOfWeek =>
isUtc ? DateTime.utc(year, month, day + 7 - weekday) : DateTime(year, month, day + 7 - weekday);

/// Returns the first day of this month
DateTime get firstDayOfMonth =>
isUtc ? DateTime.utc(year, month, 1) : DateTime(year, month, 1);
DateTime get firstDayOfMonth => isUtc ? DateTime.utc(year, month, 1) : DateTime(year, month, 1);

/// Returns the last day of this month (considers leap years)
DateTime get lastDayOfMonth =>
isUtc ? DateTime.utc(year, month + 1, 0) : DateTime(year, month + 1, 0);
DateTime get lastDayOfMonth => isUtc ? DateTime.utc(year, month + 1, 0) : DateTime(year, month + 1, 0);

/// Returns the first day of this year
DateTime get firstDayOfYear =>
isUtc ? DateTime.utc(year, 1, 1) : DateTime(year, 1, 1);
DateTime get firstDayOfYear => isUtc ? DateTime.utc(year, 1, 1) : DateTime(year, 1, 1);

/// Returns the last day of this year
DateTime get lastDayOfYear =>
isUtc ? DateTime.utc(year, 12, 31) : DateTime(year, 12, 31);
DateTime get lastDayOfYear => isUtc ? DateTime.utc(year, 12, 31) : DateTime(year, 12, 31);
}

extension DurationTimeExtension on Duration {
Expand Down

0 comments on commit 23ec82b

Please sign in to comment.