Changeset 1749332
- Timestamp:
- 10/19/2017 04:09:53 PM (8 years ago)
- Location:
- am-events/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (8 diffs)
-
script/admin-post.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
am-events/trunk/readme.txt
r1397487 r1749332 12 12 == Description == 13 13 14 The plugin adds a custom event post type with two taxonomies: event category and venue. 14 The plugin adds a custom event post type with two taxonomies: event category and venue. 15 15 16 16 Allows the user to add new events just like normal posts with added fields for start time, end time, category and venue. You can also easily create weekly or biweekly recurring events. … … 26 26 If you think something critical is missing, feel free to send me a request. I'm using this on some of my clients' sites so I'll certainly be improving/fixing it for upcoming WordPress versions. 27 27 28 The plugin is available in the following languages (pot-file included for additional translations): 28 The plugin is available in the following languages (pot-file included for additional translations): 29 29 30 30 * English … … 56 56 == Changelog == 57 57 58 = 1.13.0 = 59 * Replace jQuery datetimepicker with flatpickr 60 58 61 = 1.12.0 = 59 62 * Updated jQuery UI date/time picker … … 96 99 97 100 = 1.8.0 = 98 * Added conditional tags for the widget 101 * Added conditional tags for the widget 99 102 100 103 = 1.7.1 = … … 247 250 * [permalink] 248 251 * [meta] 249 252 250 253 Conditional shortcodes: 251 254 … … 266 269 267 270 You can use any shortcode as many times as needed in a single template. To separate date and time of start date for example you could write: 268 269 [start-date format='d.m.Y'] 271 272 [start-date format='d.m.Y'] 270 273 <span>divider</span> 271 274 [start-date format='H:i'] 272 275 273 276 Example usage of conditional shortcode: 274 277 275 [start-date format='D d.m.Y H:s'] 278 [start-date format='D d.m.Y H:s'] 276 279 [if cond='startdate-not-enddate'] 277 - [end-date format='D d.m.Y H:s'] 280 - [end-date format='D d.m.Y H:s'] 278 281 [/if] 279 282 … … 287 290 am_the_enddate($format = 'Y-m-d H:i:s', $before = '', $after = '', $echo = true) 288 291 am_get_the_enddate( $format = 'Y-m-d H:i:s', $post = 0 ) 289 292 290 293 // Template tags for getting and displaying event venues 291 294 am_get_the_venue( $id = false ) … … 301 304 302 305 Example of displaying the first category of the current event post: 303 306 304 307 $categoryArray = am_get_the_event_category(); 305 308 echo $categoryArray[0]->name; -
am-events/trunk/script/admin-post.js
r1749320 r1749332 68 68 minuteIncrement: parseInt(event_data.minuteStep) 69 69 }; 70 71 var startPicker = $('#am_startdate').flatpickr(flatpickrOptions); 72 var endPicker = $('#am_enddate').flatpickr(flatpickrOptions); 73 70 71 var startPicker = $('#am_startdate').flatpickr(Object.assign(flatpickrOptions, { 72 onChange: function(selectedDates, dateStr, instance) { 73 if (selectedDates[0] != null && (endPicker.selectedDates[0] == null || endPicker.selectedDates[0] < selectedDates[0])) { 74 endPicker.setDate(selectedDates[0]); 75 } 76 } 77 })); 78 79 var endPicker = $('#am_enddate').flatpickr(Object.assign(flatpickrOptions, { 80 onChange: function(selectedDates, dateStr, instance) { 81 if (selectedDates[0] != null && (startPicker.selectedDates[0] == null || selectedDates[0] < startPicker.selectedDates[0])) { 82 startPicker.setDate(selectedDates[0]); 83 } 84 } 85 })); 86 74 87 startPicker.setDate(event_data.startDate); 75 88 endPicker.setDate(event_data.endDate); 76 77 });89 90 startPicker.set(); 78 91 79 92 80 81 93 });
Note: See TracChangeset
for help on using the changeset viewer.