• Resolved pizon

    (@pizon)


    Hi!
    I have price list which depends on weekdays and hours during the day. After picking a date from Date & Time field user should see the correct price depending on day (ex. Monday 10$, Tuesday – 12$ etc.).
    Is there possibility to show weekday name or just index number in another field?

    Thanks in advance!

    https://ww.wp.xz.cn/plugins/calculated-fields-form/

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    If you have installed any of versions of the plugin that includes the Date Time module (The Developer, or Platinum versions), it is possible to use the “WEEKDAY” operation (please, visit the link: http://cff.dwbooster.com/documentation#datetime-module)

    For example, I will assume that the date field is the fieldname1. If you want get the index of weekday, the equation associated to the calculated field would be:

    WEEKDAY(fieldname1)

    Note: The Sunday is the day number 1, Monday the number 2, …

    If you want get the day name, the equation would be a little different:

    (function(){
    var days = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ];
    return days[ WEEKDAY(fieldname1) -1 ];
    })()

    Thank you very much for using our plugin.

Viewing 1 replies (of 1 total)

The topic ‘Weekday from datepicker’ is closed to new replies.