Changeset 1841072
- Timestamp:
- 03/16/2018 12:37:15 AM (8 years ago)
- Location:
- openmat
- Files:
-
- 5 added
- 2 edited
-
tags/1.1 (added)
-
tags/1.1/README.txt (added)
-
tags/1.1/css (added)
-
tags/1.1/css/openmat.css (added)
-
tags/1.1/openmat.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/openmat.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
openmat/trunk/README.txt
r1564790 r1841072 3 3 Tags: bjj,jiujitsu,jiu,jitsu,brazilian,openmat,training,calendar,schedule,karate,taekwondoe,wrestling,yoga,krav,maga,martial arts,bjj 4 4 Requires at least: 4.7 5 Tested up to: 4. 76 Stable tag: 1. 05 Tested up to: 4.9 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 36 36 = 1.0 = 37 37 * First version released 38 39 = 1.1 = 40 * Fixed date compare bug -
openmat/trunk/openmat.php
r1564790 r1841072 2 2 /* 3 3 Plugin Name: Openmat 4 Plugin URI: http://blog.openmat.training/2016/12/28/openmat-wordpress-plugin/4 Plugin URI: //blog.openmat.training/2016/12/28/openmat-wordpress-plugin/ 5 5 Description: Display your training calendar as a widget. 6 Version: 1. 06 Version: 1.1 7 7 Author: B. Jordan 8 8 Author URI: https://openmat.training … … 50 50 $day = date('w',$now); 51 51 52 $week_start = date( 'd', strtotime('-'.$day.' days'));53 $week_end = date( 'd', strtotime('+'.(6-$day).' days'));54 52 $week_start = date("Y-m-d", strtotime('monday this week')); 53 $week_end = date("Y-m-d", strtotime('sunday this week')); 54 55 55 $APIKey = get_option('openmat_api_key'); 56 56 $sharedSecret = get_option('openmat_shared_secret'); … … 64 64 65 65 $weekly_schedule = array(); 66 67 66 if( is_array($response) ) { 68 67 $header = $response['headers']; … … 79 78 foreach ($json_response->events as $event) { 80 79 81 if (($event->month == $month) && 82 ($event->year == $year) && 83 ($event->day >= $week_start) && 84 ($event->day <= $week_end)){ 85 80 $event_ts = strtotime($event->year. '-' . $event->month . '-' . $event->day); 81 $event_date = date("Y-m-d", $event_ts); 82 83 if ($event_date >= $week_start && $event_date <= $week_end) { 86 84 $day = (date('l',strtotime($event->year.'/'.$event->month.'/'.$event->day))); 87 88 85 $weekly_schedule[$day][] = $event; 89 86 }
Note: See TracChangeset
for help on using the changeset viewer.