Forum Post: RE: Get current user's date format for a Date Field

  • Thread starter Thread starter Orchid Corpin
  • Start date Start date
Status
Not open for further replies.
O

Orchid Corpin

Guest
Hi, I can't think of way to dynamically get the format instead you can have it hardcoded based on its value. On the event of the Date Format specify onchange function (object definition Date Field Event onchange getSelectedValue();) After specify the code below. Kindly double check if each case corresponds with your dropdown format. script function getSelectedValue() { var dateFormat = rbf_getFieldValue("dateFormat"); var format; console.log(dateFormat); switch (parseInt(dateFormat)) { case 0: format = "MM/dd/yyyy hh:mm tt"; break; case 1: format = "dd/MM/yyyy hh:mm"; break; case 2: format = "dd.mm.yyyy hh:mm"; break; case 3: format = "MM/dd/yyyy hh:mm"; break; case 4: format = "yyyy-MM-dd hh:mm"; break; case 5: format = "dd-MM-yyyy hh:mm"; break; case 6: format = "yyyy/MM/dd hh:mm"; break; case 7: format = "yyyy-MMM-dd hh:mm"; break; case 8: format = "dd/MM/yyyy hh:mm:s"; break; } console.log(format); } /script Regards, Orchid

Continue reading...
 
Status
Not open for further replies.
Back
Top