calendar_week_mod()
Get number of days since the start of the week.
No Hooks.
Return
float
. Days since the start of the week.
Usage
calendar_week_mod( $num );
- $num(int) (required)
- Number of day.
Examples
#1 Demonstration examples
echo calendar_week_mod( 15 ); // 1 (7*2+1) echo calendar_week_mod( 8 ); // 1 (7+1) echo calendar_week_mod( 30 ); // 2 (7*4+2) echo calendar_week_mod( 50 ); // 2 (7*8+2)
Changelog
Since 1.5.0 | Introduced. |
calendar_week_mod() calendar week mod code WP 6.6.1
function calendar_week_mod( $num ) { $base = 7; return ( $num - $base * floor( $num / $base ) ); }