Hi,
Thank you for waiting.
To make the "date" type field's query filter work when the time information is also available, you'll need to make the following changes.
1. Instead of a single custom shortcode from Luo's message in another thread ( ref: https://toolset.com/forums/topic/how-to-filter-a-date-field-by-an-specific-day-of-the-week/#post-1124389 ), you'll need to register two custom shortcodes.
( one for the target day's start time and the other for the target day's end time )
add_shortcode('ts_day_week_start', function($atts){
$atts = shortcode_atts( array(
'day' => 'Monday',
), $atts);
$res = strtotime('last ' . $atts['day']);
if(date('l') == $atts['day']){
$res = strtotime('this ' . $atts['day']);
}
return $res;
});
add_shortcode('ts_day_week_end', function($atts){
$atts = shortcode_atts( array(
'day' => 'Monday',
), $atts);
$res = strtotime('last ' . $atts['day']);
if(date('l') == $atts['day']){
$res = strtotime('this ' . $atts['day']);
}
$res = strtotime("tomorrow", $res) - 1;
return $res;
});
2. Next, please add "ts_day_week_start" and "ts_day_week_end" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.
3. In the "Query Filter" section of the view, adjust the query so that it looks for number values between "tsstart" and "tsend" shortcode attribute.
( screenshot: hidden link )
4. Lastly, you'll update the shortcodes of the view for each day, to include these two shortcode attributes, instead of one.
For example, the existing shortcode for Friday looks like:
[wpv-view name="schedule-view" cached="off" ts="[ts_day_week day='Friday']"]
Updated shortcode for Friday, would be:
[wpv-view name="schedule-view" cached="off" tsstart="[ts_day_week_start day='Friday']" tsend="[ts_day_week_end day='Friday']"]
Likewise, you can update the shortcodes for the other days as well.
Important note: As explained earlier, 1-1 customization assistance is beyond the scope of support that we provide over the forum.
( https://toolset.com/toolset-support-policy/ )
Since your project's requirements have grown way too complex to be handled through the support forum, we'll have to request you to hire a professional, to assist you with any further custom code changes and troubleshooting.
( https://toolset.com/contractors/ )
I hope you'll understand.
regards,
Waqar