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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c39f80bd
Commit
c39f80bd
authored
Jan 28, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor commit calendar a bit. Fixed dates
parent
815e9aa2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
18 deletions
+10
-18
app/assets/javascripts/calendar.js.coffee
app/assets/javascripts/calendar.js.coffee
+8
-8
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+2
-2
lib/gitlab/commits_calendar.rb
lib/gitlab/commits_calendar.rb
+0
-8
No files found.
app/assets/javascripts/calendar.js.coffee
View file @
c39f80bd
...
...
@@ -4,7 +4,7 @@ class @calendar
day
:
"numeric"
year
:
"numeric"
constructor
:
(
timestamps
,
starting_year
,
starting_month
,
activities_path
)
->
constructor
:
(
timestamps
,
starting_year
,
starting_month
,
activities_path
)
->
cal
=
new
CalHeatMap
()
cal
.
init
itemName
:
[
"commit"
]
...
...
app/controllers/users_controller.rb
View file @
c39f80bd
...
...
@@ -28,8 +28,8 @@ class UsersController < ApplicationController
user_repositories
=
visible_projects
.
map
(
&
:repository
)
@timestamps
=
Gitlab
::
CommitsCalendar
.
create_timestamp
(
user_repositories
,
@user
,
false
)
@starting_year
=
Gitlab
::
CommitsCalendar
.
starting_year
(
@timestamps
)
@starting_month
=
Gitlab
::
CommitsCalendar
.
starting_month
(
@timestamps
)
@starting_year
=
(
Time
.
now
-
1
.
year
).
strftime
(
"%Y"
)
@starting_month
=
Date
.
today
.
strftime
(
"%m"
).
to_i
@last_commit_date
=
Gitlab
::
CommitsCalendar
.
last_commit_date
(
@timestamps
)
respond_to
do
|
format
|
...
...
lib/gitlab/commits_calendar.rb
View file @
c39f80bd
...
...
@@ -60,14 +60,6 @@ module Gitlab
end
end
def
self
.
starting_year
(
timestamps
)
DateTime
.
now
.
to_date
-
1
end
def
self
.
starting_month
(
timestamps
)
Date
.
today
.
strftime
(
"%m"
).
to_i
end
def
self
.
last_commit_date
(
timestamps
)
latest_commit_date
(
timestamps
).
to_formatted_s
(
:long
).
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