dkent Posted September 10, 2013 Share Posted September 10, 2013 my excel speadsheet the time is set up with this starting time ending time 10:00 am 9:30 pm 11:30 am 12:00 pm is there a code to remove the :00 if it is there? and 12:00 pm - noon? Quote Link to comment Share on other sites More sharing options...
step Posted September 10, 2013 Share Posted September 10, 2013 var start = Field("Start Time"); // Your start time field var end = Field("End Time"); // Your end time field var result = start + " - " + end; // join times with a hyphen return result.replace(/\:00/g,"").replace(/12\s+?pm/,"noon"); Quote Link to comment Share on other sites More sharing options...
dkent Posted September 10, 2013 Author Share Posted September 10, 2013 I keep getting function dose not return a value do you want to ignore the error and save the rule anyway? Quote Link to comment Share on other sites More sharing options...
step Posted September 10, 2013 Share Posted September 10, 2013 Did you copy the rule exactly? Including the return line? and change my fields to the fields that you're using where I commented them in the code? Quote Link to comment Share on other sites More sharing options...
dkent Posted September 10, 2013 Author Share Posted September 10, 2013 I acting a little weird but working is the fields blank I get — what the best way to remove this — if the field are blanks? Quote Link to comment Share on other sites More sharing options...
step Posted September 10, 2013 Share Posted September 10, 2013 var start = Field("Start Time"); // Your start time field var end = Field("End Time"); // Your end time field var result = [start,end].filter(String).join(" - "); return result.replace(/\:00/g,"").replace(/12\s+?pm/,"noon"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.