day of week

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
TommyT
Veteran Member
Posts: 58
Veteran Member
    Is there a way to get the day of the week from a date? I'm sure there is an easy javascript function to do it, but would I have to add it to some js lib so process flow would provide it?
    Sam Simpson
    Veteran Member
    Posts: 239
    Veteran Member
      Open up pflow.js with notepad (this is located both in your client and server) and do the following:
      1. You'll see bunch of lines with // ***function definition //. Insert the following as the last of the group:

      //*****Function Definition -->getWeekDate(var1) //

      2. insert the following at the very end :

      /************************************************************
      Function: getWeekDate

      Purpose: returns the Day of the week
      ************************************************************/
      function getWeekDate(jsDate1)
      {
      var WeekDays= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
      whatDay=jsDate1.getDay();
      return whatDay=WeekDays[whatDay];

      }


      Note: in your process flow your variable will look like this:

      string WeekName=getWeekDate()

      Hope this help
      M Graham
      Veteran Member
      Posts: 32
      Veteran Member
        Here is another way to get the day of the week in abbreviated mode (Mon,Tue,Wed,Thr...):
        In your 'START' node, add the following variables:
        1. TodayString (Type=String) = today()
        2. DayOfWeek (Type = String) = substring(vTodayString, 0,4)