Package org.pentaho.reporting.libraries.formula.function.datetime

## Class WeekDayFunction

- java.lang.Object
- - org.pentaho.reporting.libraries.formula.function.datetime.WeekDayFunction

- All Implemented Interfaces:
    `java.io.Serializable`, `Function`

      public class WeekDayFunction
      extends java.lang.Object
      implements Function

  This function extracts the day of week from a date.

  The returned value depends of the Type passed as second argument using the following table:

  Day of Week | Type=1 Result | Type=2 Result | Type=3 Result
  --- | --- | --- | ---
  Sunday | 1 | 7 | 6
  Monday | 2 | 1 | 0
  Tuesday | 3 | 2 | 1
  Wednesday | 4 | 3 | 2
  Thursday | 5 | 4 | 3
  Friday | 6 | 5 | 4
  Saturday | 7 | 6 | 5

  Author:
    Cedric Pronzato
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WeekDayFunction()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `convertType​(int currentDayOfWeek, int type)` |
    `TypeValuePair` | `evaluate​(FormulaContext context, ParameterCallback parameters)` |
    `java.lang.String` | `getCanonicalName()` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WeekDayFunction

          public WeekDayFunction()

  - ### Method Detail

    - #### getCanonicalName

          public java.lang.String getCanonicalName()

      Specified by:
        `getCanonicalName` in interface `Function`

    - #### evaluate

          public TypeValuePair evaluate​(FormulaContext context,
                                        ParameterCallback parameters)
                                 throws EvaluationException

      Specified by:
        `evaluate` in interface `Function`
      Throws:
        `EvaluationException`

    - #### convertType

          public int convertType​(int currentDayOfWeek,
                                 int type)