rpaterick Posted June 23, 2009 Share Posted June 23, 2009 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. Thanks!test.txt Link to comment Share on other sites More sharing options...
Dan Korn Posted June 23, 2009 Share Posted June 23, 2009 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))) result.push(DayNames[i].toUpperCase()); } return result.join(" & "); Link to comment Share on other sites More sharing options...
rpaterick Posted June 24, 2009 Author Share Posted June 24, 2009 Code from Dan Wow, that worked! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.