-
Notifications
You must be signed in to change notification settings - Fork 106
Shoe/calendar #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Shoe/calendar #98
Conversation
MikeMillerGIS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you leverage the new for (var foo OF array)? it is a lot cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formated string literal
3px solid ${todayColor}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backticks did not come through, but needs a back tick at start and end
|
|
||
| var tempList = eventList | ||
| eventList=[] | ||
| for(var x in tempList){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for/of
|
|
||
| push(bumplist,h_date) | ||
| }else{ | ||
| tempYear = Year(today()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.