Shoe/calendar#98
Conversation
MikeMillerGIS
left a comment
There was a problem hiding this comment.
A standalone JS file would make a code review a lot easier
also, wonder if some of the longer code blocks can be moved to functions for easier read-ability
| return("Event List Required") | ||
| } | ||
|
|
||
| iif(IsEmpty(showCalendar),showCalendar=True,showCalendar) |
There was a problem hiding this comment.
You can remove all these and just use DefaultValue later, would be a lot cleaner
| var temp = events | ||
| var eventColors = {} | ||
| events = {} | ||
| for (var y in temp){ |
There was a problem hiding this comment.
can you leverage the new for (var foo OF array)? it is a lot cleaner
There was a problem hiding this comment.
if so, lots of places could benefit
| var eventColors = {} | ||
| events = {} | ||
| for (var y in temp){ | ||
| eventColors[temp[y]["Name"]]=temp[y]["Color"] |
There was a problem hiding this comment.
temp[y].Name (Dot Notation) is more readable
|
|
||
|
|
||
| var m_days={"January":31,"February":28,"March":31,"April":30,"May":31,"June":30, "July":31,"August":31,"September":30,"October":31,"November":30,"December":31} | ||
| var m_number={"January":0,"February":1,"March":2,"April":3,"May":4,"June":5, "July":6,"August":7,"September":8,"October":9,"November":10,"December":11} |
There was a problem hiding this comment.
could just use a list and ask for the index, instead of a dict.
|
|
||
| var m_days={"January":31,"February":28,"March":31,"April":30,"May":31,"June":30, "July":31,"August":31,"September":30,"October":31,"November":30,"December":31} | ||
| var m_number={"January":0,"February":1,"March":2,"April":3,"May":4,"June":5, "July":6,"August":7,"September":8,"October":9,"November":10,"December":11} | ||
| var m_name ={"0":"January","1":"February","2":"March","3":"April","4":"May","5":"June","6":"July","7":"August","8":"September","9":"October","10":"November","11":"December"} |
There was a problem hiding this comment.
if you used a list, it would combine this and the above
| months[m_name[text(month(EventDays[key_list[e]][d]))]][e_day]['colors'] = tempColor +eventColors[key_list[e]] + "," | ||
| } | ||
| } | ||
| months[m_name[text(month(today()))]][day(today())-1]['Border'] = "3px solid "+ todayColor |
There was a problem hiding this comment.
formated string literal
3px solid ${todayColor}
There was a problem hiding this comment.
backticks did not come through, but needs a back tick at start and end
|
|
||
| var tempList = eventList | ||
| eventList=[] | ||
| for(var x in tempList){ |
|
|
||
| push(bumplist,h_date) | ||
| }else{ | ||
| tempYear = Year(today()) |
There was a problem hiding this comment.
calling year(today()) a few times, store as a variable?
| return("schedule required") | ||
| } | ||
|
|
||
| iif(IsEmpty(weekInterval),weekInterval=1,weekInterval) |
There was a problem hiding this comment.
DefaultValue would remove this
| iif(IsEmpty(eventSeason),eventSeason=[[1,1],[12,31]],eventSeason) | ||
|
|
||
|
|
||
| var weekdays_ = {"Sunday":0,"Monday":1,"Tuesday":2,"Wednesday":3,"Thursday":4,"Friday":5,"Saturday":6} |
There was a problem hiding this comment.
use a list and index as number
Expressions that are used to generate an HTML calendar in a pop up.
Some or all of the expressions can be used to generate the calendar.