Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Get days #23

Merged
merged 1 commit into from

2 participants

@tatsuo
Owner

うーん...

@tatsuo tatsuo Get days
うーん...
370e9cc
@vestige
Owner

Rubyらしくなってきたw
サーバーからとってくるところまでかくのかと思ってたー。

@tatsuo
Owner

一気にそこからやってもいいんですけどね。
ちょっとずつプルリし合っていく、という雰囲気が作れたいいなあと思っています。

@vestige vestige merged commit 9753135 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. @tatsuo

    Get days

    tatsuo authored
    うーん...
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 16 deletions.
  1. +9 −16 app/assets/javascripts/{week.js.coffee → week.js.coffee.erb}
View
25 app/assets/javascripts/week.js.coffee → app/assets/javascripts/week.js.coffee.erb
@@ -2,22 +2,15 @@
# b: カレンダーを表示するためのデータを Rails 側で生成する
# 1 と 2 を合わせた json が渡ってくる。
-cal_days = [
- '3/4(月)',
- '3/5(火)',
- '3/6(水)',
- '3/7(木)',
- '3/8(金)',
- '3/9(土)',
- '3/10(日)',
- '3/11(月)',
- '3/12(火)',
- '3/13(水)',
- '3/14(木)',
- '3/15(金)',
- '3/16(土)',
- '3/17(日)'
-]
+<%
+day_of_weeks = %w(月 火 水 木 金 土 日)
+days = []
+(DateTime.now.beginning_of_month..DateTime.now.end_of_month).map do |datetime|
+ days << datetime.strftime("%Y/%m/%d(#{day_of_weeks[datetime.wday]})")
+end
+%>
+
+cal_days = <%= days %>
set_cal = ->
$(cal_days).each (i, day) ->
Something went wrong with that request. Please try again.