Compare commits
2 Commits
7d7f5750e3
...
9f51f508ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f51f508ce | |||
| 62824549fc |
@@ -26,13 +26,13 @@ public static class CreateConsumption
|
||||
{
|
||||
public Validator(TimeProvider timeProvider)
|
||||
{
|
||||
DateTime todayEndOfDay = timeProvider.GetUtcNow()
|
||||
Func<DateTimeOffset> getTodayEndOfDay = () => timeProvider.GetUtcNow()
|
||||
.Date
|
||||
.AddDays(1)
|
||||
.AddTicks(-1);
|
||||
|
||||
|
||||
RuleFor(x => x.DateTime.ToUniversalTime())
|
||||
.LessThanOrEqualTo(todayEndOfDay)
|
||||
.LessThanOrEqualTo(_ => getTodayEndOfDay())
|
||||
.WithName(nameof(Request.DateTime));
|
||||
|
||||
RuleFor(x => x.Distance)
|
||||
|
||||
@@ -26,13 +26,13 @@ public static class UpdateConsumption
|
||||
{
|
||||
public Validator(TimeProvider timeProvider)
|
||||
{
|
||||
DateTime todayEndOfDay = timeProvider.GetUtcNow()
|
||||
Func<DateTimeOffset> getTodayEndOfDay = () => timeProvider.GetUtcNow()
|
||||
.Date
|
||||
.AddDays(1)
|
||||
.AddTicks(-1);
|
||||
|
||||
RuleFor(x => x.DateTime.ToUniversalTime())
|
||||
.LessThanOrEqualTo(todayEndOfDay)
|
||||
.LessThanOrEqualTo(_ => getTodayEndOfDay())
|
||||
.WithName(nameof(Request.DateTime));
|
||||
|
||||
RuleFor(x => x.Distance)
|
||||
|
||||
Reference in New Issue
Block a user