Jump to content

Recommended Posts

Posted

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?

Posted
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");

Posted
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?
Posted

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?

Posted
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");

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...