Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cb514e80
Commit
cb514e80
authored
May 19, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some Time & Date usages
parent
a0bf828d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/iteration.rb
app/models/iteration.rb
+2
-2
ee/app/services/ci/minutes/email_notification_service.rb
ee/app/services/ci/minutes/email_notification_service.rb
+1
-1
ee/spec/services/iterations/create_service_spec.rb
ee/spec/services/iterations/create_service_spec.rb
+1
-1
No files found.
app/models/iteration.rb
View file @
cb514e80
...
...
@@ -88,12 +88,12 @@ class Iteration < ApplicationRecord
# ensure dates are in the future
def
future_date
if
start_date_changed?
errors
.
add
(
:start_date
,
s_
(
"Iteration|cannot be in the past"
))
if
start_date
<
Date
.
today
errors
.
add
(
:start_date
,
s_
(
"Iteration|cannot be in the past"
))
if
start_date
<
Date
.
current
errors
.
add
(
:start_date
,
s_
(
"Iteration|cannot be more than 500 years in the future"
))
if
start_date
>
500
.
years
.
from_now
end
if
due_date_changed?
errors
.
add
(
:due_date
,
s_
(
"Iteration|cannot be in the past"
))
if
due_date
<
Date
.
today
errors
.
add
(
:due_date
,
s_
(
"Iteration|cannot be in the past"
))
if
due_date
<
Date
.
current
errors
.
add
(
:due_date
,
s_
(
"Iteration|cannot be more than 500 years in the future"
))
if
due_date
>
500
.
years
.
from_now
end
end
...
...
ee/app/services/ci/minutes/email_notification_service.rb
View file @
cb514e80
...
...
@@ -20,7 +20,7 @@ module Ci
def
notify_on_total_usage
return
unless
namespace
.
shared_runners_minutes_used?
&&
namespace
.
last_ci_minutes_notification_at
.
nil?
namespace
.
update_columns
(
last_ci_minutes_notification_at:
Time
.
now
)
namespace
.
update_columns
(
last_ci_minutes_notification_at:
Time
.
current
)
CiMinutesUsageMailer
.
notify
(
namespace
.
name
,
recipients
).
deliver_later
end
...
...
ee/spec/services/iterations/create_service_spec.rb
View file @
cb514e80
...
...
@@ -20,7 +20,7 @@ describe Iterations::CreateService do
{
title:
'v2.1.9'
,
description:
'Patch release to fix security issue'
,
start_date:
Time
.
now
.
to_s
,
start_date:
Time
.
current
.
to_s
,
due_date:
1
.
day
.
from_now
.
to_s
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment