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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
261e7ea5
Commit
261e7ea5
authored
Oct 26, 2014
by
Sacred Seven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JalaliCalendar in broadcast messages
parent
3383383c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
7 deletions
+43
-7
app/views/admin/broadcast_messages/index.html.haml
app/views/admin/broadcast_messages/index.html.haml
+41
-6
app/views/projects/milestones/_form.html.haml
app/views/projects/milestones/_form.html.haml
+1
-0
config/application.rb
config/application.rb
+1
-1
No files found.
app/views/admin/broadcast_messages/index.html.haml
View file @
261e7ea5
=
stylesheet_link_tag
"JalaliJSCalendar-1.4/calendar-blue"
=
javascript_include_tag
"JalaliJSCalendar-1.4/jalali"
=
javascript_include_tag
"JalaliJSCalendar-1.4/calendar"
=
javascript_include_tag
"JalaliJSCalendar-1.4/calendar-setup"
=
javascript_include_tag
"JalaliJSCalendar-1.4/lang/calendar-fa"
%h3
.page-title
Broadcast Messages
%p
.light
...
...
@@ -30,12 +35,14 @@
.light
6 character hex values starting with a # sign.
.form-group
=
f
.
label
:starts_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:starts_at
.col-sm-10.datetime-controls
{
style:
'width: auto'
}
=
f
.
hidden_field
:starts_at
#datepicker1
.form-group
=
f
.
label
:ends_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:ends_at
.col-sm-10.datetime-controls
{
style:
'width: auto'
}
=
f
.
hidden_field
:ends_at
#datepicker2
.form-actions
=
f
.
submit
"Add broadcast message"
,
class:
"btn btn-create"
...
...
@@ -46,11 +53,11 @@
.pull-right
-
if
broadcast_message
.
starts_at
%strong
#{
broadcast_message
.
starts_at
.
to_s
(
:short
)
}
#{
JalaliDate
.
new
(
broadcast_message
.
starts_at
).
strftime
(
"%A %d %b %Y %H:%M"
)
}
\...
-
if
broadcast_message
.
ends_at
%strong
#{
broadcast_message
.
ends_at
.
to_s
(
:short
)
}
#{
JalaliDate
.
new
(
broadcast_message
.
ends_at
).
strftime
(
"%A %d %b %Y %H:%M"
)
}
=
link_to
[
:admin
,
broadcast_message
],
method: :delete
,
remote:
true
,
class:
'remove-row btn btn-tiny'
do
%i
.fa.fa-times.cred
...
...
@@ -59,3 +66,31 @@
=
paginate
@broadcast_messages
:javascript
function
utcString
(
date
)
{
var
utc
=
new
Date
(
date
.
getTime
()
+
date
.
getTimezoneOffset
()
*
60000
);
return
utc
.
toLocaleFormat
(
"
%Y/%m/%d %H:%M
"
);
}
var
now
=
new
Date
();
var
nowCounterUTC
=
new
Date
(
now
.
getTime
()
-
now
.
getTimezoneOffset
()
*
60000
);
Calendar
.
setup
({
inputField
:
"
broadcast_message_starts_at
"
,
flat
:
"
datepicker1
"
,
// id of the input field
flatCallback
:
function
(
calendar
)
{
$
(
'
#broadcast_message_starts_at
'
).
val
(
utcString
(
calendar
.
date
))},
ifFormat
:
"
%Y/%m/%d %H:%M
"
,
// format of the input field
dateType
:
'
jalali
'
,
timeFormat
:
'
24
'
,
showsTime
:
true
,
weekNumbers
:
false
}).
setDate
(
nowCounterUTC
);
Calendar
.
setup
({
inputField
:
"
broadcast_message_ends_at
"
,
flat
:
"
datepicker2
"
,
// id of the input field
flatCallback
:
function
(
calendar
)
{
$
(
'
#broadcast_message_ends_at
'
).
val
(
utcString
(
calendar
.
date
))},
ifFormat
:
"
%Y/%m/%d %H:%M
"
,
// format of the input field
dateType
:
'
jalali
'
,
timeFormat
:
'
24
'
,
showsTime
:
true
,
weekNumbers
:
false
}).
setDate
(
nowCounterUTC
);
app/views/projects/milestones/_form.html.haml
View file @
261e7ea5
...
...
@@ -51,6 +51,7 @@
:javascript
disableButtonIfEmptyField
(
"
#milestone_title
"
,
"
.btn-save
"
);
Calendar
.
setup
({
inputField
:
"
milestone_due_date
"
,
flat
:
"
datepicker
"
,
// id of the input field
flatCallback
:
function
(
calendar
)
{
$
(
'
#milestone_due_date
'
).
val
(
calendar
.
date
.
toLocaleFormat
(
"
%Y/%m/%d
"
))},
ifFormat
:
"
%Y/%m/%d
"
,
// format of the input field
...
...
config/application.rb
View file @
261e7ea5
...
...
@@ -25,7 +25,7 @@ module Gitlab
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)
'
config
.
time_zone
=
'Tehran
'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
...
...
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