Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module SchedulerHelper | ||
def frequency_options | ||
Scheduler::FREQUENCIES.each_with_index.map{ |value, index| | ||
[ I18n.t("scheduler.frequency.#{ value }.form.option"), index ] | ||
} | ||
end | ||
|
||
def week_day_order_options | ||
[1, 2, 3, -1 ].map do |d| | ||
[ | ||
t("scheduler.frequency.monthly.form.week_day_order_option.#{ d }"), | ||
d | ||
] | ||
end | ||
end | ||
|
||
def week_day_options | ||
7.times.map do |d| | ||
[ | ||
l(Date.today.beginning_of_week + d, :format => "%A"), | ||
d | ||
] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
module Scheduler | ||
FREQUENCIES = [ :one_off, :daily, :weekly, :monthly ] | ||
|
||
class << self | ||
def frequency_options | ||
FREQUENCIES.each_with_index.map{ |value, index| | ||
[ I18n.t("scheduler.frequency.#{ value }.form.option"), index ] | ||
} | ||
end | ||
end | ||
ORDER = [ :first, :second, :third, :last ] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters