Jump to content

Days of the week and inserting "&"


Recommended Posts

sample data attached.


There are either single days or multiple days that could be shown.


Single day would look like: MONDAY

Multiple days would look like: ex: TUESDAY & THURSDAY & SATURDAY


Based on the attached data file, how could I have it convert the "numbers" into days plus add "&" only when it has multiple days? Numbers are not always the same code.




Link to comment
Share on other sites

var DayNames = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var result = new Array();
for (var i = 0; i < 7; i++)
 if (Field(DayNames[i].substr(0, 2)))
return result.join(" & ");

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...