ember.js - Array of Mondays -


I am a JS / Amber Nob, so please be patient. My app has a program model that has a start and end date. I want to add function / computed property which will return an array of all weeks covering the program.

The original psovedocode will look something like this:

  weeks: amber .computed, - & gt; Monday_array = [] If start_date.day_of_week! = Monday Monday = Monday before start date Monday = start_date on Monday & lt; I am not sure how this will start and I am not getting any help from the Amber API or other online resources any kind of help. Will be welcomed. If it means that I am using coffescript   

is slightly different that is basically described But this is the same idea.

  Week: Amber dot cop 'start_at', 'end_at', - & gt; Arr = [] current_monday = @getMonday (@get ('start_at')) if date (@getMonday (@gat ('ends_at'))) New Date (DateTodayAdata) + 7) End_markay = New Date (@Gate Monde (@Gate ('and_at')) Android_Mandu = New Date (@get Momde (DateTodayaget + 21date)) while current_com & lt; = End_monday newDate = current_monday.setDate (current_com.redited) + 7) current_support = new date (new day) arr.push (return to current_with) go back Monday: (d) - & gt; D = New date (D) days = d.getDay () diff = d.getDate () - Day + ((if day is 0 -6 and 1)) # Adjust the date when the new date of Sunday (d. Setdate (Diff))  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -