diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..40b6c8f Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md old mode 100644 new mode 100755 index a6dd2ce..15320eb --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If needed, admin notices will give helpful links and prompting to get Keyring an * like `WP_Query` for Eventbrite events (it extends `WP_Query`) * creates a secondary loop * supported arguments, passed as an array - * `display_private`: (*boolean*) Include user events marked as Private. Default is `false`. Note that this changes the endpoint called from `event_search` to `user_owned_events`. See the [Eventbrite API docs](https://www.eventbrite.com/developer/v3/) for details. + * `display_private`: (*boolean*) Include user events marked as Private. Default is `false`. Note that this changes the endpoint called from `event_search` to `user_events`. See the [Eventbrite API docs](https://www.eventbrite.com/developer/v3/) for details. * `limit`: (*integer*) Return a maximum number of results. * `organizer_id`: (*integer*) Return only events for a certain organizer. * `p`: (*integer*) Get a single event. diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/css/calendar.css b/assets/css/calendar.css new file mode 100644 index 0000000..71b8f47 --- /dev/null +++ b/assets/css/calendar.css @@ -0,0 +1,360 @@ + +.eventbrite-event-calendar { + padding-top: 0px; + display: none; +} + +.eventbrite-calendar-icons { + text-align: center; + overflow: hidden; + margin: 30px 0px; + font-size: 40px; +} + +.eventbrite-calendar-icons a { + margin: 0px 10px; + text-decoration: none; + vertical-align: middle; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + filter: alpha(opacity=50); + opacity: 0.5; +} + +.eventbrite-calendar-icons a.active, +.eventbrite-calendar-icons a:hover { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); + opacity: 1; +} + +.eventbrite-event-calendar .noselect { + -webkit-user-select: none; + /* Chrome/Safari */ + -moz-user-select: none; + /* Firefox */ + -ms-user-select: none; + /* IE10+ */ +} +.eventbrite-full-clndr h4 { + width: 75%; + text-align: center; + font-weight: normal; + color: white; + font-size: 14px; + margin: 0 auto 1em auto; + padding: 1em; + background: #b63642; +} +.eventbrite-full-clndr p { + text-align: center; + margin: 3em auto 1em auto; + padding-top: 0.5em; + padding-bottom: 0.5em; + border-bottom: 2px solid #414141; + background: #f4f4f4; +} +.eventbrite-full-clndr .left-align { + text-align: left; +} +.eventbrite-full-clndr .right-align { + text-align: right; +} + +.clndr-next-button, +.clndr-previous-button, +.clndr-next-year-button, +.clndr-previous-year-button { + -webkit-user-select: none; + /* Chrome/Safari */ + -moz-user-select: none; + /* Firefox */ + -ms-user-select: none; + /* IE10+ */ +} +.clndr-next-button.inactive, +.clndr-previous-button.inactive, +.clndr-next-year-button.inactive, +.clndr-previous-year-button.inactive { + opacity: 0.5; + cursor: default; +} + + +.eventbrite-full-clndr { + margin-top: 0; +} + +.current-month { + text-transform: uppercase; + font-weight: normal; +} + +.buy-tickets { + padding: 5px; + margin-top: 10px; + text-align: center; + text-transform: uppercase; + position: absolute; + bottom: 10px; + text-align:: center; + width:100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +#event-calendar tbody > tr > .day { + display: table-cell !important; +} + +.clndr-event > .event { + padding: 10px 0 0 0; + text-align: center; +} + +.clndr-event > .nectar-calendar { + background: none !important; + margin: 0; +} + +.clndr-event > .nectar-calendar img { + width: 95%; + margin-bottom: 15px; + margin-left: auto; + margin-right: auto; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; +} +.clndr-event > .nectar-calendar img:hover { + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + filter: alpha(opacity=80); + opacity: 0.8; +} + +.day-number { + position: absolute; + top: 5px; + right: 5px; + font-weight: 300; + font-size: 21px; + color: #666666; +} + +.day.past, .day { + position: relative; +} + +.current-month { + font-size: 32px; +} + +.clndr-previous-button, .clndr-next-button { + font-size: 18px; + margin-top:10px; +} + +.clndr-event{ + font-weight: normal; + text-transform: uppercase; + font-size: 11px; +} + +.eventbrite-full-clndr { + width: 100%; + background-color: white; + font-weight: 700; +} +.eventbrite-full-clndr .clndr-controls { + padding: 14px; + background-color: #a6a9a8; + color: white; + text-align: center; +} +.eventbrite-full-clndr .clndr-controls .clndr-previous-button { + float: left; + text-align: left; +} +.eventbrite-full-clndr .clndr-controls .clndr-next-button { + float: right; + text-align: right; +} +.eventbrite-full-clndr .clndr-controls .clndr-previous-button, +.eventbrite-full-clndr .clndr-controls .clndr-next-button { + width: 30px; + cursor: pointer; + -webkit-user-select: none; + /* Chrome/Safari */ + + -moz-user-select: none; + /* Firefox */ + + -ms-user-select: none; + /* IE10+ */ + +} +.eventbrite-full-clndr .clndr-controls .clndr-previous-button:hover, +.eventbrite-full-clndr .clndr-controls .clndr-next-button:hover { + opacity: 0.5; +} +.eventbrite-full-clndr .clndr-grid { + width: 100%; +} +.eventbrite-full-clndr .clndr-grid .days-of-the-week { + width: 100%; + background-color: #666666; + font-weight: normal; + overflow: hidden; +} +.eventbrite-full-clndr .clndr-grid .days-of-the-week .header-day { + float: left; + width: 14.2857%; + padding: 14px 0px; + text-align: center; + color: white; +} +.eventbrite-full-clndr .clndr-grid .days { + width: 100%; + overflow: hidden; +} +.eventbrite-full-clndr .clndr-grid .days .day, +.eventbrite-full-clndr .clndr-grid .days .empty { + overflow: hidden; + float: left; + width: 14.2857%; + height: 230px ; + padding: 24px 0; + text-align: center; + color: #4f4f4f; + background-color: white; + border: 1px solid #aaaaaa; + background-size: cover; + background-position: center; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.eventbrite-full-clndr .clndr-grid .days .day.event .day-number, +.eventbrite-full-clndr .clndr-grid .days .empty.event .day-number { + padding-bottom: 4px; +} +.eventbrite-full-clndr .clndr-grid .days .day.adjacent-month .day-number, +.eventbrite-full-clndr .clndr-grid .days .empty.adjacent-month .day-number { + opacity: 0.3; +} +.eventbrite-full-clndr .clndr-grid .days .today { + background-color: white; + background-image: none; +} +.eventbrite-full-clndr .event-listing { + float: left; + width: 35%; +} +.eventbrite-full-clndr .event-listing .event-listing-title { + padding: 14px; + background-color: #71bbd2; + text-align: center; + color: white; + letter-spacing: 1px; +} +.eventbrite-full-clndr .event-listing .event-item { + padding: 14px; + color: #4f4f4f; +} +.eventbrite-full-clndr .event-listing .event-item-location { + font-weight: 400; +} +.noselect { + -webkit-user-select: none; + /* Chrome/Safari */ + + -moz-user-select: none; + /* Firefox */ + + -ms-user-select: none; + /* IE10+ */ + +} + + +.eventbrite-event-calendar .get-ticket { + padding: 11px 10px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition: All 0.5s ease; + -webkit-transition: All 0.5s ease; + -moz-transition: All 0.5s ease; + -o-transition: All 0.5s ease; + font-size: 12px; + font-family: Arial; + display: inline-block; + line-height: normal; +} + +.eventbrite-event-calendar .get-ticket:hover { + background-color: #00451b; +} + +.eventbrite-event-calendar .get-ticket.sold_out { + background-color: #ffdb00; + color: #332c00; +} + +.eventbrite-event-calendar .get-ticket.sold_out:hover { + background-color: #d7b903; +} + +.eventbrite-event-calendar .get-ticket.sold_out, +.eventbrite-event-calendar .get-ticket.unavailable { + background-color: #ffdb00; + color: #332c00; +} + +.eventbrite-event-calendar .get-ticket.sold_out:hover, +.eventbrite-event-calendar .get-ticket.unavailable:hover { + background-color: #d7b903; +} + +.eventbrite-event-calendar .get-ticket.not_yet_on_sale { + background-color: #666666; +} + +.eventbrite-event-calendar .get-ticket.not_yet_on_sale:hover { + background-color: #555555; +} + +.eventbrite-event-calendar .get-ticket.no_link { + display:none; +} + + +@media( max-width: 768px ){ + .eventbrite-event-calendar .days-of-the-week { + display: none; + } + .eventbrite-full-clndr .clndr-grid .days .day { + width: 33.333%; + } +} + +@media( max-width: 500px ){ + .current-month { + font-size: 26px; + } + .clndr-previous-button, + .clndr-next-button { + margin-top: 5px; + } +} \ No newline at end of file diff --git a/assets/js/clndr.js b/assets/js/clndr.js new file mode 100644 index 0000000..6a8e12c --- /dev/null +++ b/assets/js/clndr.js @@ -0,0 +1,1216 @@ +/* + * ~ CLNDR v1.2.14 ~ + * ============================================== + * https://github.com/kylestetz/CLNDR + * ============================================== + * created by kyle stetz (github.com/kylestetz) + * &available under the MIT license + * http://opensource.org/licenses/mit-license.php + * ============================================== + * + * This is the fully-commented development version of CLNDR. + * For the production version, check out clndr.min.js + * at https://github.com/kylestetz/CLNDR + * + * This work is based on the + * jQuery lightweight plugin boilerplate + * Original author: @ajpiano + * Further changes, comments: @addyosmani + * Licensed under the MIT license + */ + +(function (factory) { + + if (typeof define === 'function' && define.amd) { + + // AMD. Register as an anonymous module. + define(['jquery', 'moment'], factory); + } else if (typeof exports === 'object') { + + // Node/CommonJS + factory(require('jquery'), require('moment')); + } else { + + // Browser globals + factory(jQuery, moment); + } + +}(function ($, moment) { + + // This is the default calendar template. This can be overridden. + var clndrTemplate = "
" + + "
previous
<%= month %> <%= year %>
next
" + + "
" + + "" + + "" + + "" + + "<% for(var i = 0; i < daysOfTheWeek.length; i++) { %>" + + "" + + "<% } %>" + + "" + + "" + + "" + + "<% for(var i = 0; i < numberOfRows; i++){ %>" + + "" + + "<% for(var j = 0; j < 7; j++){ %>" + + "<% var d = j + i * 7; %>" + + "" + + "<% } %>" + + "" + + "<% } %>" + + "" + + "
<%= daysOfTheWeek[i] %>
<%= days[d].day %>" + + "
"; + + var pluginName = 'clndr'; + + var defaults = { + template: clndrTemplate, + weekOffset: 0, + startWithMonth: null, + clickEvents: { + click: null, + nextMonth: null, + previousMonth: null, + nextYear: null, + previousYear: null, + today: null, + onMonthChange: null, + onYearChange: null + }, + targets: { + nextButton: 'clndr-next-button', + previousButton: 'clndr-previous-button', + nextYearButton: 'clndr-next-year-button', + previousYearButton: 'clndr-previous-year-button', + todayButton: 'clndr-today-button', + day: 'day', + empty: 'empty' + }, + classes: { + today: "today", + event: "event", + past: "past", + lastMonth: "last-month", + nextMonth: "next-month", + adjacentMonth: "adjacent-month", + inactive: "inactive", + selected: "selected" + }, + events: [], + extras: null, + dateParameter: 'date', + multiDayEvents: null, + doneRendering: null, + render: null, + daysOfTheWeek: null, + showAdjacentMonths: true, + adjacentDaysChangeMonth: false, + ready: null, + constraints: null, + forceSixRows: null, + trackSelectedDate: false, + selectedDate: null, + lengthOfTime: { + months: null, + days: null, + interval: 1 + } + }; + + // The actual plugin constructor + function Clndr( element, options ) { + this.element = element; + + // merge the default options with user-provided options + this.options = $.extend(true, {}, defaults, options); + + // if there are events, we should run them through our addMomentObjectToEvents function + // which will add a date object that we can use to make life easier. This is only necessary + // when events are provided on instantiation, since our setEvents function uses addMomentObjectToEvents. + if(this.options.events.length) { + if(this.options.multiDayEvents) { + this.options.events = this.addMultiDayMomentObjectsToEvents(this.options.events); + } else { + this.options.events = this.addMomentObjectToEvents(this.options.events); + } + } + + // this used to be a place where we'd figure out the current month, but since + // we want to open up support for arbitrary lengths of time we're going to + // store the current range in addition to the current month. + if(this.options.lengthOfTime.months || this.options.lengthOfTime.days) { + // we want to establish intervalStart and intervalEnd, which will keep track + // of our boundaries. Let's look at the possibilities... + if(this.options.lengthOfTime.months) { + // gonna go right ahead and annihilate any chance for bugs here. + this.options.lengthOfTime.days = null; + // the length is specified in months. Is there a start date? + if(this.options.lengthOfTime.startDate) { + this.intervalStart = moment(this.options.lengthOfTime.startDate).startOf('month'); + } else if(this.options.startWithMonth) { + this.intervalStart = moment(this.options.startWithMonth).startOf('month'); + } else { + this.intervalStart = moment().startOf('month'); + } + // subtract a day so that we are at the end of the interval. We always + // want intervalEnd to be inclusive. + this.intervalEnd = moment(this.intervalStart).add(this.options.lengthOfTime.months, 'months').subtract(1, 'days'); + this.month = this.intervalStart.clone(); + } else if(this.options.lengthOfTime.days) { + // the length is specified in days. Start date? + if(this.options.lengthOfTime.startDate) { + this.intervalStart = moment(this.options.lengthOfTime.startDate).startOf('day'); + } else { + this.intervalStart = moment().weekday(0).startOf('day'); + } + this.intervalEnd = moment(this.intervalStart).add(this.options.lengthOfTime.days - 1, 'days').endOf('day'); + this.month = this.intervalStart.clone(); + } + } else { + this.month = moment().startOf('month'); + this.intervalStart = moment(this.month); + this.intervalEnd = moment(this.month).endOf('month'); + } + + if(this.options.startWithMonth) { + this.month = moment(this.options.startWithMonth).startOf('month'); + this.intervalStart = moment(this.month); + this.intervalEnd = moment(this.month).endOf('month'); + } + + // if we've got constraints set, make sure the interval is within them. + if(this.options.constraints) { + // first check if the start date exists & is later than now. + if(this.options.constraints.startDate) { + var startMoment = moment(this.options.constraints.startDate); + if(this.intervalStart.isBefore(startMoment, 'month')) { + // try to preserve the date by moving only the month... + this.intervalStart.set('month', startMoment.month()).set('year', startMoment.year()); + this.month.set('month', startMoment.month()).set('year', startMoment.year()); + } + } + // make sure the intervalEnd is before the endDate + if(this.options.constraints.endDate) { + var endMoment = moment(this.options.constraints.endDate); + if(this.intervalEnd.isAfter(endMoment, 'month')) { + this.intervalEnd.set('month', endMoment.month()).set('year', endMoment.year()); + this.month.set('month', endMoment.month()).set('year', endMoment.year()); + } + } + } + + this._defaults = defaults; + this._name = pluginName; + + // Some first-time initialization -> day of the week offset, + // template compiling, making and storing some elements we'll need later, + // & event handling for the controller. + this.init(); + } + + Clndr.prototype.init = function () { + // create the days of the week using moment's current language setting + this.daysOfTheWeek = this.options.daysOfTheWeek || []; + if(!this.options.daysOfTheWeek) { + this.daysOfTheWeek = []; + for(var i = 0; i < 7; i++) { + this.daysOfTheWeek.push( moment().weekday(i).format('dd').charAt(0) ); + } + } + // shuffle the week if there's an offset + if(this.options.weekOffset) { + this.daysOfTheWeek = this.shiftWeekdayLabels(this.options.weekOffset); + } + + // quick & dirty test to make sure rendering is possible. + if( !$.isFunction(this.options.render) ) { + this.options.render = null; + if (typeof _ === 'undefined') { + throw new Error("Underscore was not found. Please include underscore.js OR provide a custom render function."); + } + else { + // we're just going ahead and using underscore here if no render method has been supplied. + this.compiledClndrTemplate = _.template(this.options.template); + } + } + + // create the parent element that will hold the plugin & save it for later + $(this.element).html("
"); + this.calendarContainer = $('.clndr', this.element); + + // attach event handlers for clicks on buttons/cells + this.bindEvents(); + + // do a normal render of the calendar template + this.render(); + + // if a ready callback has been provided, call it. + if(this.options.ready) { + this.options.ready.apply(this, []); + } + }; + + Clndr.prototype.shiftWeekdayLabels = function(offset) { + var days = this.daysOfTheWeek; + for(var i = 0; i < offset; i++) { + days.push( days.shift() ); + } + return days; + }; + + // This is where the magic happens. Given a starting date and ending date, + // an array of calendarDay objects is constructed that contains appropriate + // events and classes depending on the circumstance. + Clndr.prototype.createDaysObject = function(startDate, endDate) { + // this array will hold numbers for the entire grid (even the blank spaces) + var daysArray = []; + var date = startDate.clone(); + var lengthOfInterval = endDate.diff(startDate, 'days'); + + // this is a helper object so that days can resolve their classes correctly. + // Don't use it for anything please. + this._currentIntervalStart = startDate.clone(); + + // filter the events list (if it exists) to events that are happening last month, this month and next month (within the current grid view) + this.eventsLastMonth = []; + this.eventsThisInterval = []; + this.eventsNextMonth = []; + + if(this.options.events.length) { + + // EVENT PARSING + // here are the only two cases where we don't get an event in our interval: + // startDate | endDate | e.start | e.end + // e.start | e.end | startDate | endDate + this.eventsThisInterval = $(this.options.events).filter( function() { + if( + this._clndrEndDateObject.isBefore(startDate) || + this._clndrStartDateObject.isAfter(endDate) + ) { + return false; + } else { + return true; + } + }).toArray(); + + if(this.options.showAdjacentMonths) { + var startOfLastMonth = startDate.clone().subtract(1, 'months').startOf('month'); + var endOfLastMonth = startOfLastMonth.clone().endOf('month'); + var startOfNextMonth = endDate.clone().add(1, 'months').startOf('month'); + var endOfNextMonth = startOfNextMonth.clone().endOf('month'); + + this.eventsLastMonth = $(this.options.events).filter( function() { + if( + this._clndrEndDateObject.isBefore(startOfLastMonth) || + this._clndrStartDateObject.isAfter(endOfLastMonth) + ) { + return false; + } else { + return true; + } + }).toArray(); + + this.eventsNextMonth = $(this.options.events).filter( function() { + if( + this._clndrEndDateObject.isBefore(startOfNextMonth) || + this._clndrStartDateObject.isAfter(endOfNextMonth) + ) { + return false; + } else { + return true; + } + }).toArray(); + } + } + + // if diff is greater than 0, we'll have to fill in last days of the previous month + // to account for the empty boxes in the grid. + // we also need to take into account the weekOffset parameter. + // None of this needs to happen if the interval is being specified in days rather than months. + if(!this.options.lengthOfTime.days) { + var diff = date.weekday() - this.options.weekOffset; + if(diff < 0) diff += 7; + + if(this.options.showAdjacentMonths) { + for(var i = 0; i < diff; i++) { + var day = moment([startDate.year(), startDate.month(), i - diff + 1]); + daysArray.push( this.createDayObject(day, this.eventsLastMonth) ); + } + } else { + for(var i = 0; i < diff; i++) { + daysArray.push( this.calendarDay({ + classes: this.options.targets.empty + " " + this.options.classes.lastMonth + }) ); + } + } + } + + // now we push all of the days in the interval + var dateIterator = startDate.clone(); + while( dateIterator.isBefore(endDate) || dateIterator.isSame(endDate, 'day') ) { + daysArray.push( this.createDayObject(dateIterator.clone(), this.eventsThisInterval) ); + dateIterator.add(1, 'days'); + } + + // ...and if there are any trailing blank boxes, fill those in + // with the next month first days. + // Again, we can ignore this if the interval is specified in days. + if(!this.options.lengthOfTime.days) { + while(daysArray.length % 7 !== 0) { + if(this.options.showAdjacentMonths) { + daysArray.push( this.createDayObject(dateIterator.clone(), this.eventsNextMonth) ); + } else { + daysArray.push( this.calendarDay({ + classes: this.options.targets.empty + " " + this.options.classes.nextMonth + }) ); + } + dateIterator.add(1, 'days'); + } + } + + // if we want to force six rows of calendar, now's our Last Chance to add another row. + // if the 42 seems explicit it's because we're creating a 7-row grid and 6 rows of 7 is always 42! + if(this.options.forceSixRows && daysArray.length !== 42 ) { + while(daysArray.length < 42) { + if(this.options.showAdjacentMonths) { + daysArray.push( this.createDayObject(dateIterator.clone(), this.eventsNextMonth) ); + dateIterator.add(1, 'days'); + } else { + daysArray.push( this.calendarDay({ + classes: this.options.targets.empty + " " + this.options.classes.nextMonth + }) ); + } + } + } + + return daysArray; + }; + + Clndr.prototype.createDayObject = function(day, monthEvents) { + var eventsToday = []; + var now = moment(); + var self = this; + + // validate moment date + if (!day.isValid() && day.hasOwnProperty('_d') && day._d != undefined) { + day = moment(day._d); + } + + var j = 0, l = monthEvents.length; + for(j; j < l; j++) { + // keep in mind that the events here already passed the month/year test. + // now all we have to compare is the moment.date(), which returns the day of the month. + var start = monthEvents[j]._clndrStartDateObject; + var end = monthEvents[j]._clndrEndDateObject; + // if today is the same day as start or is after the start, and + // if today is the same day as the end or before the end ... + // woohoo semantics! + if( ( day.isSame(start, 'day') || day.isAfter(start, 'day') ) && + ( day.isSame(end, 'day') || day.isBefore(end, 'day') ) ) { + eventsToday.push( monthEvents[j] ); + } + } + + var properties = { + isInactive: false, + isAdjacentMonth: false, + isToday: false, + }; + var extraClasses = ""; + + if(now.format("YYYY-MM-DD") == day.format("YYYY-MM-DD")) { + extraClasses += (" " + this.options.classes.today); + properties.isToday = true; + } + if(day.isBefore(now, 'day')) { + extraClasses += (" " + this.options.classes.past); + } + if(eventsToday.length) { + extraClasses += (" " + this.options.classes.event); + } + if(!this.options.lengthOfTime.days) { + if(this._currentIntervalStart.month() > day.month()) { + extraClasses += (" " + this.options.classes.adjacentMonth); + properties.isAdjacentMonth = true; + + this._currentIntervalStart.year() === day.year() + ? extraClasses += (" " + this.options.classes.lastMonth) + : extraClasses += (" " + this.options.classes.nextMonth); + + } else if(this._currentIntervalStart.month() < day.month()) { + extraClasses += (" " + this.options.classes.adjacentMonth); + properties.isAdjacentMonth = true; + + this._currentIntervalStart.year() === day.year() + ? extraClasses += (" " + this.options.classes.nextMonth) + : extraClasses += (" " + this.options.classes.lastMonth); + } + } + + // if there are constraints, we need to add the inactive class to the days outside of them + if(this.options.constraints) { + if(this.options.constraints.startDate && day.isBefore(moment( this.options.constraints.startDate ))) { + extraClasses += (" " + this.options.classes.inactive); + properties.isInactive = true; + } + if(this.options.constraints.endDate && day.isAfter(moment( this.options.constraints.endDate ))) { + extraClasses += (" " + this.options.classes.inactive); + properties.isInactive = true; + } + } + + // validate moment date + if (!day.isValid() && day.hasOwnProperty('_d') && day._d != undefined) { + day = moment(day._d); + } + + // check whether the day is "selected" + if (this.options.selectedDate && day.isSame(moment(this.options.selectedDate), 'day')) { + extraClasses += (" " + this.options.classes.selected); + } + + // we're moving away from using IDs in favor of classes, since when + // using multiple calendars on a page we are technically violating the + // uniqueness of IDs. + extraClasses += " calendar-day-" + day.format("YYYY-MM-DD"); + + // day of week + extraClasses += " calendar-dow-" + day.weekday(); + + return this.calendarDay({ + day: day.date(), + classes: this.options.targets.day + extraClasses, + events: eventsToday, + date: day, + properties: properties + }); + }; + + Clndr.prototype.render = function() { + // get rid of the previous set of calendar parts. + // TODO: figure out if this is the right way to ensure proper garbage collection? + this.calendarContainer.children().remove(); + + var data = {}; + + if(this.options.lengthOfTime.days) { + var days = this.createDaysObject(this.intervalStart.clone(), this.intervalEnd.clone()); + + data = { + daysOfTheWeek: this.daysOfTheWeek, + numberOfRows: Math.ceil(days.length / 7), + months: [], + days: days, + month: null, + year: null, + intervalStart: this.intervalStart.clone(), + intervalEnd: this.intervalEnd.clone(), + eventsThisInterval: this.eventsThisInterval, + eventsLastMonth: [], + eventsNextMonth: [], + extras: this.options.extras + }; + + } else if(this.options.lengthOfTime.months) { + + var months = []; + var eventsThisInterval = []; + + for(i = 0; i < this.options.lengthOfTime.months; i++) { + var currentIntervalStart = this.intervalStart.clone().add(i, 'months'); + var currentIntervalEnd = currentIntervalStart.clone().endOf('month'); + var days = this.createDaysObject(currentIntervalStart, currentIntervalEnd); + // save events processed for each month into a master array of events for + // this interval + eventsThisInterval.push(this.eventsThisInterval); + months.push({ + month: currentIntervalStart, + days: days + }); + } + + data = { + daysOfTheWeek: this.daysOfTheWeek, + numberOfRows: _.reduce(months, function(memo, monthObj) { + return memo + Math.ceil(monthObj.days.length / 7); + }, 0), + months: months, + days: [], + month: null, + year: null, + intervalStart: this.intervalStart, + intervalEnd: this.intervalEnd, + eventsThisInterval: eventsThisInterval, + eventsLastMonth: this.eventsLastMonth, + eventsNextMonth: this.eventsNextMonth, + extras: this.options.extras + }; + } else { + // get an array of days and blank spaces + var days = this.createDaysObject(this.month.clone().startOf('month'), this.month.clone().endOf('month')); + // this is to prevent a scope/naming issue between this.month and data.month + var currentMonth = this.month; + + var data = { + daysOfTheWeek: this.daysOfTheWeek, + numberOfRows: Math.ceil(days.length / 7), + months: [], + days: days, + month: this.month.format('MMMM'), + year: this.month.year(), + eventsThisMonth: this.eventsThisInterval, + eventsLastMonth: this.eventsLastMonth, + eventsNextMonth: this.eventsNextMonth, + extras: this.options.extras + }; + } + + // render the calendar with the data above & bind events to its elements + if(!this.options.render) { + this.calendarContainer.html(this.compiledClndrTemplate(data)); + } else { + this.calendarContainer.html(this.options.render.apply(this, [data])); + } + + // if there are constraints, we need to add the 'inactive' class to the controls + if(this.options.constraints) { + // in the interest of clarity we're just going to remove all inactive classes and re-apply them each render. + for(var target in this.options.targets) { + if(target != this.options.targets.day) { + this.element.find('.' + this.options.targets[target]).toggleClass(this.options.classes.inactive, false); + } + } + + var start = null; + var end = null; + + if(this.options.constraints.startDate) { + start = moment(this.options.constraints.startDate); + } + if(this.options.constraints.endDate) { + end = moment(this.options.constraints.endDate); + } + // deal with the month controls first. + // do we have room to go back? + if(start && (start.isAfter(this.intervalStart) || start.isSame(this.intervalStart, 'day'))) { + this.element.find('.' + this.options.targets.previousButton).toggleClass(this.options.classes.inactive, true); + } + // do we have room to go forward? + if(end && (end.isBefore(this.intervalEnd) || end.isSame(this.intervalEnd, 'day'))) { + this.element.find('.' + this.options.targets.nextButton).toggleClass(this.options.classes.inactive, true); + } + // what's last year looking like? + if(start && start.isAfter(this.intervalStart.clone().subtract(1, 'years')) ) { + this.element.find('.' + this.options.targets.previousYearButton).toggleClass(this.options.classes.inactive, true); + } + // how about next year? + if(end && end.isBefore(this.intervalEnd.clone().add(1, 'years')) ) { + this.element.find('.' + this.options.targets.nextYearButton).toggleClass(this.options.classes.inactive, true); + } + // today? we could put this in init(), but we want to support the user changing the constraints on a living instance. + if(( start && start.isAfter( moment(), 'month' ) ) || ( end && end.isBefore( moment(), 'month' ) )) { + this.element.find('.' + this.options.targets.today).toggleClass(this.options.classes.inactive, true); + } + } + + if(this.options.doneRendering) { + this.options.doneRendering.apply(this, []); + } + }; + + Clndr.prototype.bindEvents = function() { + var $container = $(this.element); + var self = this; + var eventType = 'click'; + if (self.options.useTouchEvents === true) { + eventType = 'touchstart'; + } + + // target the day elements and give them click events + $container.on(eventType +'.clndr', '.'+this.options.targets.day, function(event) { + if(self.options.clickEvents.click) { + var target = self.buildTargetObject(event.currentTarget, true); + self.options.clickEvents.click.apply(self, [target]); + } + // if adjacentDaysChangeMonth is on, we need to change the month here. + if(self.options.adjacentDaysChangeMonth) { + if($(event.currentTarget).is( '.' + self.options.classes.lastMonth )) { + self.backActionWithContext(self); + } else if($(event.currentTarget).is( '.' + self.options.classes.nextMonth )) { + self.forwardActionWithContext(self); + } + } + // if trackSelectedDate is on, we need to handle click on a new day + if (self.options.trackSelectedDate) { + // remember new selected date + self.options.selectedDate = self.getTargetDateString(event.currentTarget); + + // handle "selected" class + $(event.currentTarget) + .siblings().removeClass(self.options.classes.selected).end() + .addClass(self.options.classes.selected); + } + }); + // target the empty calendar boxes as well + $container.on(eventType +'.clndr', '.'+this.options.targets.empty, function(event) { + if(self.options.clickEvents.click) { + var target = self.buildTargetObject(event.currentTarget, false); + self.options.clickEvents.click.apply(self, [target]); + } + if(self.options.adjacentDaysChangeMonth) { + if($(event.currentTarget).is( '.' + self.options.classes.lastMonth )) { + self.backActionWithContext(self); + } else if($(event.currentTarget).is( '.' + self.options.classes.nextMonth )) { + self.forwardActionWithContext(self); + } + } + }); + + // bind the previous, next and today buttons + $container + .on(eventType +'.clndr', '.'+this.options.targets.previousButton, { context: this }, this.backAction) + .on(eventType +'.clndr', '.'+this.options.targets.nextButton, { context: this }, this.forwardAction) + .on(eventType +'.clndr', '.'+this.options.targets.todayButton, { context: this }, this.todayAction) + .on(eventType +'.clndr', '.'+this.options.targets.nextYearButton, { context: this }, this.nextYearAction) + .on(eventType +'.clndr', '.'+this.options.targets.previousYearButton, { context: this }, this.previousYearAction); + } + + // If the user provided a click callback we'd like to give them something nice to work with. + // buildTargetObject takes the DOM element that was clicked and returns an object with + // the DOM element, events, and the date (if the latter two exist). Currently it is based on the id, + // however it'd be nice to use a data- attribute in the future. + Clndr.prototype.buildTargetObject = function(currentTarget, targetWasDay) { + // This is our default target object, assuming we hit an empty day with no events. + var target = { + element: currentTarget, + events: [], + date: null + }; + // did we click on a day or just an empty box? + if(targetWasDay) { + var dateString = this.getTargetDateString(currentTarget); + target.date = (dateString) ? moment(dateString) : null; + + // do we have events? + if(this.options.events) { + // are any of the events happening today? + if(this.options.multiDayEvents) { + target.events = $.makeArray( $(this.options.events).filter( function() { + // filter the dates down to the ones that match. + return ( ( target.date.isSame(this._clndrStartDateObject, 'day') || target.date.isAfter(this._clndrStartDateObject, 'day') ) && + ( target.date.isSame(this._clndrEndDateObject, 'day') || target.date.isBefore(this._clndrEndDateObject, 'day') ) ); + }) ); + } else { + target.events = $.makeArray( $(this.options.events).filter( function() { + // filter the dates down to the ones that match. + return this._clndrStartDateObject.format('YYYY-MM-DD') == dateString; + }) ); + } + } + } + + return target; + } + + // get moment date object of the date associated with the given target. + // this method is meant to be called on ".day" elements. + Clndr.prototype.getTargetDateString = function(target) { + // Our identifier is in the list of classNames. Find it! + var classNameIndex = target.className.indexOf('calendar-day-'); + if(classNameIndex !== -1) { + // our unique identifier is always 23 characters long. + // If this feels a little wonky, that's probably because it is. + // Open to suggestions on how to improve this guy. + return target.className.substring(classNameIndex + 13, classNameIndex + 23); + } + + return null; + } + + // the click handlers in bindEvents need a context, so these are wrappers + // to the actual functions. Todo: better way to handle this? + Clndr.prototype.forwardAction = function(event) { + var self = event.data.context; + self.forwardActionWithContext(self); + }; + + Clndr.prototype.backAction = function(event) { + var self = event.data.context; + self.backActionWithContext(self); + }; + + // These are called directly, except for in the bindEvent click handlers, + // where forwardAction and backAction proxy to these guys. + Clndr.prototype.backActionWithContext = function(self) { + // before we do anything, check if there is an inactive class on the month control. + // if it does, we want to return and take no action. + if(self.element.find('.' + self.options.targets.previousButton).hasClass('inactive')) { + return; + } + + var yearChanged = null; + + if(!self.options.lengthOfTime.days) { + // shift the interval by a month (or several months) + self.intervalStart.subtract(self.options.lengthOfTime.interval, 'months').startOf('month'); + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.months || self.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + + if(!self.options.lengthOfTime.months) { + yearChanged = !self.month.isSame( moment(self.month).subtract(1, 'months'), 'year'); + } + + self.month = self.intervalStart.clone(); + } else { + // shift the interval in days + self.intervalStart.subtract(self.options.lengthOfTime.interval, 'days').startOf('day'); + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.days - 1, 'days').endOf('day'); + // this is useless, i think, but i'll keep it as a precaution for now + self.month = self.intervalStart.clone(); + } + + self.render(); + + if(!self.options.lengthOfTime.days && !self.options.lengthOfTime.months) { + if(self.options.clickEvents.previousMonth) { + self.options.clickEvents.previousMonth.apply( self, [moment(self.month)] ); + } + if(self.options.clickEvents.onMonthChange) { + self.options.clickEvents.onMonthChange.apply( self, [moment(self.month)] ); + } + if(yearChanged) { + if(self.options.clickEvents.onYearChange) { + self.options.clickEvents.onYearChange.apply( self, [moment(self.month)] ); + } + } + } else { + if(self.options.clickEvents.previousInterval) { + self.options.clickEvents.previousInterval.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + if(self.options.clickEvents.onIntervalChange) { + self.options.clickEvents.onIntervalChange.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + } + }; + + Clndr.prototype.forwardActionWithContext = function(self) { + // before we do anything, check if there is an inactive class on the month control. + // if it does, we want to return and take no action. + if(self.element.find('.' + self.options.targets.nextButton).hasClass('inactive')) { + return; + } + + var yearChanged = null; + + if(!self.options.lengthOfTime.days) { + // shift the interval by a month (or several months) + self.intervalStart.add(self.options.lengthOfTime.interval, 'months').startOf('month'); + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.months || self.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + + if(!self.options.lengthOfTime.months) { + yearChanged = !self.month.isSame( moment(self.month).add(1, 'months'), 'year'); + } + + self.month = self.intervalStart.clone(); + } else { + // shift the interval in days + self.intervalStart.add(self.options.lengthOfTime.interval, 'days').startOf('day'); + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.days - 1, 'days').endOf('day'); + // this is useless, i think, but i'll keep it as a precaution for now + self.month = self.intervalStart.clone(); + } + + self.render(); + + if(!self.options.lengthOfTime.days && !self.options.lengthOfTime.months) { + if(self.options.clickEvents.previousMonth) { + self.options.clickEvents.previousMonth.apply( self, [moment(self.month)] ); + } + if(self.options.clickEvents.onMonthChange) { + self.options.clickEvents.onMonthChange.apply( self, [moment(self.month)] ); + } + if(yearChanged) { + if(self.options.clickEvents.onYearChange) { + self.options.clickEvents.onYearChange.apply( self, [moment(self.month)] ); + } + } + } else { + if(self.options.clickEvents.nextInterval) { + self.options.clickEvents.nextInterval.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + if(self.options.clickEvents.onIntervalChange) { + self.options.clickEvents.onIntervalChange.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + } + }; + + Clndr.prototype.todayAction = function(event) { + var self = event.data.context; + + // did we switch months when the today button was hit? + var monthChanged = !self.month.isSame(moment(), 'month'); + var yearChanged = !self.month.isSame(moment(), 'year'); + + self.month = moment().startOf('month'); + + if(self.options.lengthOfTime.days) { + // if there was a startDate specified, we should figure out what the weekday is and + // use that as the starting point of our interval. If not, go to today.weekday(0) + if(self.options.lengthOfTime.startDate) { + self.intervalStart = moment().weekday(self.options.lengthOfTime.startDate.weekday()).startOf('day'); + } else { + self.intervalStart = moment().weekday(0).startOf('day'); + } + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.days - 1, 'days').endOf('day'); + + } else if(self.options.lengthOfTime.months) { + // set the intervalStart to this month. + self.intervalStart = moment().startOf('month'); + self.intervalEnd = self.intervalStart.clone().add(self.options.lengthOfTime.months || self.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + } else if(monthChanged) { + // no need to re-render if we didn't change months. + self.render(); + + // fire the today event handler regardless of whether the month changed. + if(self.options.clickEvents.today) { + self.options.clickEvents.today.apply( self, [moment(self.month)] ); + } + + // fire the onMonthChange callback + if(self.options.clickEvents.onMonthChange) { + self.options.clickEvents.onMonthChange.apply( self, [moment(self.month)] ); + } + // maybe fire the onYearChange callback? + if(yearChanged) { + if(self.options.clickEvents.onYearChange) { + self.options.clickEvents.onYearChange.apply( self, [moment(self.month)] ); + } + } + } + + if(self.options.lengthOfTime.days || self.options.lengthOfTime.months) { + self.render(); + // fire the today event handler regardless of whether the month changed. + if(self.options.clickEvents.today) { + self.options.clickEvents.today.apply( self, [moment(self.month)] ); + } + if(self.options.clickEvents.onIntervalChange) { + self.options.clickEvents.onIntervalChange.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + } + }; + + Clndr.prototype.nextYearAction = function(event) { + var self = event.data.context; + // before we do anything, check if there is an inactive class on the month control. + // if it does, we want to return and take no action. + if(self.element.find('.' + self.options.targets.nextYearButton).hasClass('inactive')) { + return; + } + + self.month.add(1, 'years'); + self.intervalStart.add(1, 'years'); + self.intervalEnd.add(1, 'years'); + + self.render(); + + if(self.options.clickEvents.nextYear) { + self.options.clickEvents.nextYear.apply( self, [moment(self.month)] ); + } + if(self.options.lengthOfTime.days || self.options.lengthOfTime.months) { + if(self.options.clickEvents.onIntervalChange) { + self.options.clickEvents.onIntervalChange.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + } else { + if(self.options.clickEvents.onMonthChange) { + self.options.clickEvents.onMonthChange.apply( self, [moment(self.month)] ); + } + if(self.options.clickEvents.onYearChange) { + self.options.clickEvents.onYearChange.apply( self, [moment(self.month)] ); + } + } + }; + + Clndr.prototype.previousYearAction = function(event) { + var self = event.data.context; + // before we do anything, check if there is an inactive class on the month control. + // if it does, we want to return and take no action. + console.log(self.element.find('.' + self.options.targets.previousYear)); + if(self.element.find('.' + self.options.targets.previousYearButton).hasClass('inactive')) { + return; + } + + self.month.subtract(1, 'years'); + self.intervalStart.subtract(1, 'years'); + self.intervalEnd.subtract(1, 'years'); + + self.render(); + + if(self.options.clickEvents.previousYear) { + self.options.clickEvents.previousYear.apply( self, [moment(self.month)] ); + } + if(self.options.lengthOfTime.days || self.options.lengthOfTime.months) { + if(self.options.clickEvents.onIntervalChange) { + self.options.clickEvents.onIntervalChange.apply( self, [moment(self.intervalStart), moment(self.intervalEnd)] ); + } + } else { + if(self.options.clickEvents.onMonthChange) { + self.options.clickEvents.onMonthChange.apply( self, [moment(self.month)] ); + } + if(self.options.clickEvents.onYearChange) { + self.options.clickEvents.onYearChange.apply( self, [moment(self.month)] ); + } + } + }; + + Clndr.prototype.forward = function(options) { + if(!this.options.lengthOfTime.days) { + // shift the interval by a month (or several months) + this.intervalStart.add(this.options.lengthOfTime.interval, 'months').startOf('month'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.months || this.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + this.month = this.intervalStart.clone(); + } else { + // shift the interval in days + this.intervalStart.add(this.options.lengthOfTime.interval, 'days').startOf('day'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.days - 1, 'days').endOf('day'); + this.month = this.intervalStart.clone(); + } + + this.render(); + + if(options && options.withCallbacks) { + if(this.options.lengthOfTime.days || this.options.lengthOfTime.months) { + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } else { + if(this.options.clickEvents.onMonthChange) { + this.options.clickEvents.onMonthChange.apply( this, [moment(this.month)] ); + } + // We entered a new year + if (this.month.month() === 0 && this.options.clickEvents.onYearChange) { + this.options.clickEvents.onYearChange.apply( this, [moment(this.month)] ); + } + } + } + + return this; + } + + Clndr.prototype.back = function(options) { + if(!this.options.lengthOfTime.days) { + // shift the interval by a month (or several months) + this.intervalStart.subtract(this.options.lengthOfTime.interval, 'months').startOf('month'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.months || this.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + this.month = this.intervalStart.clone(); + } else { + // shift the interval in days + this.intervalStart.subtract(this.options.lengthOfTime.interval, 'days').startOf('day'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.days - 1, 'days').endOf('day'); + this.month = this.intervalStart.clone(); + } + + this.render(); + + if(options && options.withCallbacks) { + if(this.options.lengthOfTime.days || this.options.lengthOfTime.months) { + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } else { + if(this.options.clickEvents.onMonthChange) { + this.options.clickEvents.onMonthChange.apply( this, [moment(this.month)] ); + } + // We went all the way back to previous year + if (this.month.month() === 11 && this.options.clickEvents.onYearChange) { + this.options.clickEvents.onYearChange.apply( this, [moment(this.month)] ); + } + } + } + + return this; + } + + // alternate names for convenience + Clndr.prototype.next = function(options) { + this.forward(options); + return this; + } + + Clndr.prototype.previous = function(options) { + this.back(options); + return this; + } + + Clndr.prototype.setMonth = function(newMonth, options) { + // accepts 0 - 11 or a full/partial month name e.g. "Jan", "February", "Mar" + if(!this.options.lengthOfTime.days && !this.options.lengthOfTime.months) { + this.month.month(newMonth); + this.intervalStart = this.month.clone().startOf('month'); + this.intervalEnd = this.intervalStart.clone().endOf('month'); + this.render(); + if(options && options.withCallbacks) { + if(this.options.clickEvents.onMonthChange) { + this.options.clickEvents.onMonthChange.apply( this, [moment(this.month)] ); + } + } + } else { + console.log('You are using a custom date interval; use Clndr.setIntervalStart(startDate) instead.'); + } + return this; + } + + Clndr.prototype.setIntervalStart = function(newDate, options) { + // accepts a date string or moment object + if(this.options.lengthOfTime.days) { + this.intervalStart = moment(newDate).startOf('day'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.days - 1, 'days').endOf('day'); + } else if(this.options.lengthOfTime.months) { + this.intervalStart = moment(newDate).startOf('month'); + this.intervalEnd = this.intervalStart.clone().add(this.options.lengthOfTime.months || this.options.lengthOfTime.interval, 'months').subtract(1, 'days').endOf('month'); + this.month = this.intervalStart.clone(); + } + + if(this.options.lengthOfTime.days || this.options.lengthOfTime.months) { + this.render(); + + if(options && options.withCallbacks) { + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } + } else { + console.log('You are using a custom date interval; use Clndr.setIntervalStart(startDate) instead.'); + } + return this; + } + + Clndr.prototype.nextYear = function(options) { + this.month.add(1, 'year'); + this.intervalStart.add(1, 'year'); + this.intervalEnd.add(1, 'year'); + this.render(); + if(options && options.withCallbacks) { + if(this.options.clickEvents.onYearChange) { + this.options.clickEvents.onYearChange.apply( this, [moment(this.month)] ); + } + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } + return this; + } + + Clndr.prototype.previousYear = function(options) { + this.month.subtract(1, 'year'); + this.intervalStart.subtract(1, 'year'); + this.intervalEnd.subtract(1, 'year'); + this.render(); + if(options && options.withCallbacks) { + if(this.options.clickEvents.onYearChange) { + this.options.clickEvents.onYearChange.apply( this, [moment(this.month)] ); + } + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } + return this; + } + + Clndr.prototype.setYear = function(newYear, options) { + this.month.year(newYear); + this.intervalStart.year(newYear); + this.intervalEnd.year(newYear); + this.render(); + if(options && options.withCallbacks) { + if(this.options.clickEvents.onYearChange) { + this.options.clickEvents.onYearChange.apply( this, [moment(this.month)] ); + } + if(this.options.clickEvents.onIntervalChange) { + this.options.clickEvents.onIntervalChange.apply( this, [moment(this.intervalStart), moment(this.intervalEnd)] ); + } + } + return this; + } + + Clndr.prototype.setEvents = function(events) { + // go through each event and add a moment object + if(this.options.multiDayEvents) { + this.options.events = this.addMultiDayMomentObjectsToEvents(events); + } else { + this.options.events = this.addMomentObjectToEvents(events); + } + + this.render(); + return this; + }; + + Clndr.prototype.addEvents = function(events) { + // go through each event and add a moment object + if(this.options.multiDayEvents) { + this.options.events = $.merge(this.options.events, this.addMultiDayMomentObjectsToEvents(events)); + } else { + this.options.events = $.merge(this.options.events, this.addMomentObjectToEvents(events)); + } + + this.render(); + return this; + }; + + Clndr.prototype.removeEvents = function(matchingFunction) { + for (var i = this.options.events.length-1; i >= 0; i--) { + if(matchingFunction(this.options.events[i]) == true) { + this.options.events.splice(i, 1); + } + } + + this.render(); + return this; + }; + + Clndr.prototype.addMomentObjectToEvents = function(events) { + var self = this; + var i = 0, l = events.length; + for(i; i < l; i++) { + // add the date as both start and end, since it's a single-day event by default + events[i]._clndrStartDateObject = moment( events[i][self.options.dateParameter] ); + events[i]._clndrEndDateObject = moment( events[i][self.options.dateParameter] ); + } + return events; + } + + Clndr.prototype.addMultiDayMomentObjectsToEvents = function(events) { + var self = this; + var i = 0, l = events.length; + for(i; i < l; i++) { + // if we don't find the startDate OR endDate fields, look for singleDay + if(!events[i][self.options.multiDayEvents.endDate] && !events[i][self.options.multiDayEvents.startDate]) { + events[i]._clndrEndDateObject = moment( events[i][self.options.multiDayEvents.singleDay] ); + events[i]._clndrStartDateObject = moment( events[i][self.options.multiDayEvents.singleDay] ); + } else { + // otherwise use startDate and endDate, or whichever one is present. + events[i]._clndrEndDateObject = moment( events[i][self.options.multiDayEvents.endDate] || events[i][self.options.multiDayEvents.startDate] ); + events[i]._clndrStartDateObject = moment( events[i][self.options.multiDayEvents.startDate] || events[i][self.options.multiDayEvents.endDate] ); + } + } + return events; + } + + Clndr.prototype.calendarDay = function(options) { + var defaults = { day: "", classes: this.options.targets.empty, events: [], date: null }; + return $.extend({}, defaults, options); + } + + $.fn.clndr = function(options) { + if(this.length === 1) { + if(!this.data('plugin_clndr')) { + var clndr_instance = new Clndr(this, options); + this.data('plugin_clndr', clndr_instance); + return clndr_instance; + } + } else if(this.length > 1) { + throw new Error("CLNDR does not support multiple elements yet. Make sure your clndr selector returns only one element."); + } + } + +})); \ No newline at end of file diff --git a/assets/js/eventbrite-calendar.js b/assets/js/eventbrite-calendar.js new file mode 100644 index 0000000..fae94f8 --- /dev/null +++ b/assets/js/eventbrite-calendar.js @@ -0,0 +1,31 @@ +var $ = jQuery; + +$(document).ready( function() { + $("body").on("click",".eventbrite-calendar-icons a",function(e){ + e.preventDefault(); + $( this ).parent().find( '.active' ).removeClass( 'active' ); + $( this ).addClass( 'active' ); + if( $( this ).is( '.event-display-list' ) ){ + $( '.eventbrite-event-calendar' ).hide(); + $( '.eventbrite-event-list' ).show(); + } + + if( $( this ).is( '.event-display-calendar' ) ){ + init_eventbrite_calendar(); + $( '.eventbrite-event-calendar' ).show(); + $( '.eventbrite-event-list' ).hide(); + } + }); +}); + +function init_eventbrite_calendar(){ + if( typeof eventbrite_calendar_data != 'undefined' ){ + $( '.eventbrite-full-clndr' ).each( function(){ + $( this ).clndr({ + template: $( this ).find( '.full-clndr-template' ).html(), + events: eventbrite_calendar_data, + forceSixRows: true + }); + }); + } +} \ No newline at end of file diff --git a/assets/js/moment-2.8.3.js b/assets/js/moment-2.8.3.js new file mode 100644 index 0000000..69f3724 --- /dev/null +++ b/assets/js/moment-2.8.3.js @@ -0,0 +1,10 @@ +//! moment.js +//! version : 2.8.3 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +(function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return zb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function e(a){tb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return m(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){qc[a]||(e(b),qc[a]=!0)}function h(a,b){return function(c){return p(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function j(){}function k(a,b){b!==!1&&F(a),n(this,a),this._d=new Date(+a._d)}function l(a){var b=y(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=tb.localeData(),this._bubble()}function m(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function n(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Ib.length>0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=jc[a]||kc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>23?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}function G(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){return b._isUTC?tb(a).zone(b._offset||0):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=pc[d[b]]?pc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),lc[b]||(lc[b]=M(b)),lc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Zb;case"DDDD":return _b;case"YYYY":case"GGGG":case"gggg":return d?ac:Rb;case"Y":case"G":case"g":return cc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?bc:Sb;case"S":if(d)return Zb;case"SS":if(d)return $b;case"SSS":if(d)return _b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"X":return Xb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?$b:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return Yb;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(hc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[Bb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function W(a){if(a._f===tb.ISO_8601)return void $(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=O(a._f,a._locale).match(Nb)||[],b=0;b0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),pc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),R(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Db]<12&&(a._a[Db]+=12),a._isPm===!1&&12===a._a[Db]&&(a._a[Db]=0),T(a),F(a)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=dc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f=fc[b][0]+(e[6]||" ");break}for(b=0,c=gc.length;c>b;b++)if(gc[b][1].exec(d)){a._f+=gc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;ca&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c=b._i,d=b._f;return b._locale=b._locale||tb.localeData(b._l),null===c||d===a&&""===c?tb.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=b._locale.preparse(c)),tb.isMoment(c)?new k(c,!0):(d?u(d)?Z(b):W(b):bb(b),new k(b)))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){return p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},qc={},rc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];nc.length;)vb=nc.pop(),pc[vb+"o"]=i(pc[vb],vb);for(;oc.length;)vb=oc.pop(),pc[vb+vb]=h(pc[vb],2);pc.DDDD=h(pc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=tb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=ec,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return mc[b]===a?!1:c===a?mc[b]:(mc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._locale=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=rc.length-1;vb>=0;--vb)z(rc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 00:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()+a):+this.clone().startOf(b)>+tb(a).startOf(b)},isBefore:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):+this.clone().startOf(b)<+tb(a).startOf(b)},isSame:function(a,b){return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):+this.clone().startOf(b)===+K(a,this).startOf(b)},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Use moment().localeData() instead.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+qb(this._months/12),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in ic)c(ic,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"; +return a+c}}),function(a){a(tb)}(function(a){return a.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){var b={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},c={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};return a.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:function(a){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return c[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){var b={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},c={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},d=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},e={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},f=function(a){return function(b,c){var f=d(b),g=e[a][d(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},g=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];return a.defineLocale("ar",{months:g,monthsShort:g,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:function(a){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:f("s"),m:f("m"),mm:f("m"),h:f("h"),hh:f("h"),d:f("d"),dd:f("d"),M:f("M"),MM:f("M"),y:f("y"),yy:f("y")},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return c[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){var b={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return a.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiem:function(a){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinal:function(a){if(0===a)return a+"-ıncı";var c=a%10,d=a%100-c,e=a>=100?100:null;return a+(b[c]||b[d]||b[e])},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:c?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===d?c?"хвіліна":"хвіліну":"h"===d?c?"гадзіна":"гадзіну":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"),accusative:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),accusative:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_")},d=/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.defineLocale("be",{months:d,monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:e,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:c,mm:c,h:c,hh:c,d:"дзень",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiem:function(a){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},c={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return a.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কএক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"রাত":10>a?"শকাল":17>a?"দুপুর":20>a?"বিকেল":"রাত"},week:{dow:0,doy:6}})}),function(a){a(tb)}(function(a){var b={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},c={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return a.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}),function(a){a(tb)}(function(b){function c(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+f(d[c],a)}function d(a){switch(e(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function e(a){return a>9?e(a%10):a}function f(a,b){return 2===b?g(a):a}function g(b){var c={m:"v",b:"v",d:"z"};return c[b.charAt(0)]===a?b:c[b.charAt(0)]+b.substring(1)}return b.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY LT",LLLL:"dddd, D [a viz] MMMM YYYY LT"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:c,h:"un eur",hh:"%d eur",d:"un devezh",dd:c,M:"ur miz",MM:c,y:"ur bloaz",yy:d},ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a){return a>1&&5>a&&1!==~~(a/10)}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekund":"pár sekundami";case"m":return c?"minuta":e?"minutu":"minutou";case"mm":return c||e?f+(b(a)?"minuty":"minut"):f+"minutami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodin"):f+"hodinami";break;case"d":return c||e?"den":"dnem";case"dd":return c||e?f+(b(a)?"dny":"dní"):f+"dny";break;case"M":return c||e?"měsíc":"měsícem";case"MM":return c||e?f+(b(a)?"měsíce":"měsíců"):f+"měsíci";break;case"y":return c||e?"rok":"rokem";case"yy":return c||e?f+(b(a)?"roky":"let"):f+"lety"}}var d="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),e="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");return a.defineLocale("cs",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("cv",{months:"кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),monthsShort:"кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кç_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]",LLL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT",LLLL:"dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ĕнер] LT [сехетре]",nextWeek:"[Çитес] dddd LT [сехетре]",lastWeek:"[Иртнĕ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/çул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пĕр-ик çеккунт",m:"пĕр минут",mm:"%d минут",h:"пĕр сехет",hh:"%d сехет",d:"пĕр кун",dd:"%d кун",M:"пĕр уйăх",MM:"%d уйăх",y:"пĕр çул",yy:"%d çул"},ordinal:"%d-мĕш",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd [d.] D. MMMM YYYY LT"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?d[c][0]:d[c][1]}return a.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:b,mm:"%d Minuten",h:b,hh:"%d Stunden",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?d[c][0]:d[c][1]}return a.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:b,mm:"%d Minuten",h:b,hh:"%d Stunden",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return"function"==typeof c&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinal:function(a){return a+"η"},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY LT",LLLL:"dddd, D MMMM, YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}})}),function(a){a(tb)}(function(a){return a.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY LT",LLLL:"dddd, [la] D[-an de] MMMM, YYYY LT"},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinal:"%da",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),c="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return a.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}return a.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:"%d päeva",M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}}) +}),function(a){a(tb)}(function(a){return a.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] LT",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] LT",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] LT",llll:"ddd, YYYY[ko] MMM D[a] LT"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},c={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};return a.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:function(a){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return c[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]}).replace(/,/g,"،")},ordinal:"%dم",week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){function b(a,b,d,e){var f="";switch(d){case"s":return e?"muutaman sekunnin":"muutama sekunti";case"m":return e?"minuutin":"minuutti";case"mm":f=e?"minuutin":"minuuttia";break;case"h":return e?"tunnin":"tunti";case"hh":f=e?"tunnin":"tuntia";break;case"d":return e?"päivän":"päivä";case"dd":f=e?"päivän":"päivää";break;case"M":return e?"kuukauden":"kuukausi";case"MM":f=e?"kuukauden":"kuukautta";break;case"y":return e?"vuoden":"vuosi";case"yy":f=e?"vuoden":"vuotta"}return f=c(a,e)+" "+f}function c(a,b){return 10>a?b?e[a]:d[a]:a}var d="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),e=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",d[7],d[8],d[9]];return a.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] LT",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] LT",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] LT",llll:"ddd, Do MMM YYYY, [klo] LT"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")}})}),function(a){a(tb)}(function(a){return a.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY LT",LLLL:"dddd, D [ב]MMMM YYYY LT",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a+" שנים"}}})}),function(a){a(tb)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.defineLocale("hr",{months:"sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function c(a){return(a?"":"[múlt] ")+"["+d[this.day()]+"] LT[-kor]"}var d="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");return a.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D., LT",LLLL:"YYYY. MMMM D., dddd LT"},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return c.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return c.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a){var b="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return b[a.month()]}function d(a){var b="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return b[a.day()]}return a.defineLocale("hy-am",{months:b,monthsShort:c,weekdays:d,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., LT",LLLL:"dddd, D MMMM YYYY թ., LT"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a){return a%100===11?!0:a%10===1?!1:!0}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return c?"mínúta":"mínútu";case"mm":return b(a)?f+(c||e?"mínútur":"mínútum"):c?f+"mínúta":f+"mínútu";case"hh":return b(a)?f+(c||e?"klukkustundir":"klukkustundum"):f+"klukkustund";case"d":return c?"dagur":e?"dag":"degi";case"dd":return b(a)?c?f+"dagar":f+(e?"daga":"dögum"):c?f+"dagur":f+(e?"dag":"degi");case"M":return c?"mánuður":e?"mánuð":"mánuði";case"MM":return b(a)?c?f+"mánuðir":f+(e?"mánuði":"mánuðum"):c?f+"mánuður":f+(e?"mánuð":"mánuði");case"y":return c||e?"ár":"ári";case"yy":return b(a)?f+(c||e?"ár":"árum"):f+(c||e?"ár":"ári")}}return a.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd, D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:c,m:c,mm:c,h:"klukkustund",hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(a){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}),function(a){a(tb)}(function(a){function b(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.defineLocale("ka",{months:b,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:c,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:function(a){return 12>a?"오전":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:"%d일",meridiemParse:/(오전|오후)/,isPM:function(a){return"오후"===a}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?d[c][0]:d[c][1]}function c(a){var b=a.substr(0,a.indexOf(" "));return e(b)?"a "+a:"an "+a}function d(a){var b=a.substr(0,a.indexOf(" "));return e(b)?"viru "+a:"virun "+a}function e(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return e(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return e(a)}return a/=1e3,e(a)}return a.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:c,past:d,s:"e puer Sekonnen",m:b,mm:"%d Minutten",h:b,hh:"%d Stonnen",d:b,dd:"%d Deeg",M:b,MM:"%d Méint",y:b,yy:"%d Joer"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function c(a,b,c,d){return b?e(c)[0]:d?e(c)[1]:e(c)[2]}function d(a){return a%10===0||a>10&&20>a}function e(a){return h[a].split("_")}function f(a,b,f,g){var h=a+" ";return 1===a?h+c(a,b,f[0],g):b?h+(d(a)?e(f)[1]:e(f)[0]):g?h+e(f)[1]:h+(d(a)?e(f)[1]:e(f)[2])}function g(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=i[a.day()];return c?d:d.substring(0,d.length-2)+"į"}var h={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"},i="sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_");return a.defineLocale("lt",{months:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:g,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], LT [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, LT [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], LT [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, LT [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:b,m:c,mm:f,h:c,hh:f,d:c,dd:f,M:c,MM:f,y:c,yy:f},ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d=a.split("_");return c?b%10===1&&11!==b?d[2]:d[3]:b%10===1&&11!==b?d[0]:d[1]}function c(a,c,e){return a+" "+b(d[e],a,c)}var d={mm:"minūti_minūtes_minūte_minūtes",hh:"stundu_stundas_stunda_stundas",dd:"dienu_dienas_diena_dienas",MM:"mēnesi_mēnešus_mēnesis_mēneši",yy:"gadu_gadus_gads_gadi"};return a.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, LT",LLLL:"YYYY. [gada] D. MMMM, dddd, LT"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"%s vēlāk",past:"%s agrāk",s:"dažas sekundes",m:"minūti",mm:c,h:"stundu",hh:c,d:"dienu",dd:c,M:"mēnesi",MM:c,y:"gadu",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiem:function(a){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}})}),function(a){a(tb)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}),function(a){a(tb)}(function(a){return a.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},c={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"}; +return a.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tirs_ons_tors_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),c="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");return a.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function c(a,c,d){var e=a+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(b(a)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(b(a)?"godziny":"godzin");case"MM":return e+(b(a)?"miesiące":"miesięcy");case"yy":return e+(b(a)?"lata":"lat")}}var d="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),e="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return a.defineLocale("pl",{months:function(a,b){return/D MMMM/.test(b)?e[a.month()]:d[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:c,mm:c,h:c,hh:c,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:c,y:"rok",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] LT",LLLL:"dddd, D [de] MMMM [de] YYYY [às] LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº"})}),function(a){a(tb)}(function(a){return a.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]}return a.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:b,h:"o oră",hh:b,d:"o zi",dd:b,M:"o lună",MM:b,y:"un an",yy:b},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===d?c?"минута":"минуту":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function f(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.defineLocale("ru",{months:d,monthsShort:e,weekdays:f,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:c,mm:c,h:"час",hh:c,d:"день",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){function b(a){return a>1&&5>a}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekúnd":"pár sekundami";case"m":return c?"minúta":e?"minútu":"minútou";case"mm":return c||e?f+(b(a)?"minúty":"minút"):f+"minútami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodín"):f+"hodinami";break;case"d":return c||e?"deň":"dňom";case"dd":return c||e?f+(b(a)?"dni":"dní"):f+"dňami";break;case"M":return c||e?"mesiac":"mesiacom";case"MM":return c||e?f+(b(a)?"mesiace":"mesiacov"):f+"mesiacmi";break;case"y":return c||e?"rok":"rokom";case"yy":return c||e?f+(b(a)?"roky":"rokov"):f+"rokmi"}}var d="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),e="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");return a.defineLocale("sk",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"ena minuta":"eno minuto";case"mm":return d+=1===a?"minuta":2===a?"minuti":3===a||4===a?"minute":"minut";case"h":return b?"ena ura":"eno uro";case"hh":return d+=1===a?"ura":2===a?"uri":3===a||4===a?"ure":"ur";case"dd":return d+=1===a?"dan":"dni";case"MM":return d+=1===a?"mesec":2===a?"meseca":3===a||4===a?"mesece":"mesecev";case"yy":return d+=1===a?"leto":2===a?"leti":3===a||4===a?"leta":"let"}}return a.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[prejšnja] dddd [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"%s nazaj",s:"nekaj sekund",m:b,mm:b,h:b,hh:b,d:"en dan",dd:b,M:"en mesec",MM:b,y:"eno leto",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiem:function(a){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){var b={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"дан",dd:b.translate,M:"месец",MM:b.translate,y:"годину",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){var b={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"dan",dd:b.translate,M:"mesec",MM:b.translate,y:"godinu",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"dddd LT",lastWeek:"[Förra] dddd[en] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":3===b?"e":"e";return a+c},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinal:function(a){return a+"வது"},meridiem:function(a){return a>=6&&10>=a?" காலை":a>=10&&14>=a?" நண்பகல்":a>=14&&18>=a?" எற்பாடு":a>=18&&20>=a?" மாலை":a>=20&&24>=a?" இரவு":a>=0&&6>=a?" வைகறை":void 0},week:{dow:0,doy:6}})}),function(a){a(tb)}(function(a){return a.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา LT",LLLL:"วันddddที่ D MMMM YYYY เวลา LT"},meridiem:function(a){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}),function(a){a(tb)}(function(a){return a.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM DD, YYYY LT"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){var b={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){if(0===a)return a+"'ıncı";var c=a%10,d=a%100-c,e=a>=100?100:null;return a+(b[c]||b[d]||b[e])},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){return a.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}),function(a){a(tb)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===d?c?"хвилина":"хвилину":"h"===d?c?"година":"годину":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function f(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}return a.defineLocale("uk",{months:d,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:e,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., LT",LLLL:"dddd, D MMMM YYYY р., LT"},calendar:{sameDay:f("[Сьогодні "),nextDay:f("[Завтра "),lastDay:f("[Вчора "),nextWeek:f("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return f("[Минулої] dddd [").call(this);case 1:case 2:case 4:return f("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:c,mm:c,h:"годину",hh:c,d:"день",dd:c,M:"місяць",MM:c,y:"рік",yy:c},meridiem:function(a){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"D MMMM YYYY, dddd LT"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}),function(a){a(tb)}(function(a){return a.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY LT",LLLL:"dddd, D MMMM [năm] YYYY LT",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){a(tb)}(function(a){return a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日LT",llll:"YYYY年MMMD日ddddLT"},meridiem:function(a,b){var c=100*a+b; +return 600>c?"凌晨":900>c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}})}),tb.locale("en"),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}).call(this); \ No newline at end of file diff --git a/eventbrite-api-overview.png b/eventbrite-api-overview.png old mode 100644 new mode 100755 diff --git a/eventbrite-api.php b/eventbrite-api.php index b483737..af0a9b6 100644 --- a/eventbrite-api.php +++ b/eventbrite-api.php @@ -26,6 +26,9 @@ function eventbrite_check_existing_token() { if ( ! empty( $tokens[0] ) ) { update_option( 'eventbrite_api_token', $tokens[0]->unique_id ); } + + // mark activation + update_option( 'eventbrite_api_plugin_actived', true ); } register_activation_hook( __FILE__, 'eventbrite_check_existing_token' ); @@ -46,11 +49,24 @@ function eventbrite_api_init() { // No point loading unless we have an active Eventbrite connection. if ( Eventbrite_Requirements::has_active_connection() ) { + require_once( 'inc/functions.php' ); require_once( 'inc/class-eventbrite-manager.php' ); require_once( 'inc/class-eventbrite-query.php' ); require_once( 'inc/class-eventbrite-templates.php' ); require_once( 'inc/class-eventbrite-event.php' ); - require_once( 'inc/functions.php' ); + require_once( 'inc/class-eventbrite-calendar.php' ); + require_once( 'inc/class-eventbrite-custom-events.php' ); + require_once( 'inc/class-eventbrite-webhook.php' ); + + if( is_admin() ){ + require_once( 'inc/class-eventbrite-admin.php' ); + } + + // remove activation mark + update_option( 'eventbrite_api_plugin_actived', false ); + + // Remove webhook on plugin deactivation + register_deactivation_hook( __FILE__, array( new Eventbrite_Webhook(), 'remove_webhook' ) ); } } add_action( 'init', 'eventbrite_api_init' ); diff --git a/inc/.DS_Store b/inc/.DS_Store new file mode 100644 index 0000000..e9a358c Binary files /dev/null and b/inc/.DS_Store differ diff --git a/inc/admin/custom-event-metabox.php b/inc/admin/custom-event-metabox.php new file mode 100755 index 0000000..fa47737 --- /dev/null +++ b/inc/admin/custom-event-metabox.php @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
\ No newline at end of file diff --git a/inc/admin/settings-page.php b/inc/admin/settings-page.php new file mode 100755 index 0000000..09828e5 --- /dev/null +++ b/inc/admin/settings-page.php @@ -0,0 +1,35 @@ +

+
+ + + get_settings(); + $values = $this->get_setting_values(); + foreach( $options as $name => $option ){ + ?> + + + + + + + + + +
+ checked="checked" value='1'> +
+ +
+
\ No newline at end of file diff --git a/inc/class-eventbrite-admin.php b/inc/class-eventbrite-admin.php new file mode 100755 index 0000000..84de4c1 --- /dev/null +++ b/inc/class-eventbrite-admin.php @@ -0,0 +1,169 @@ +get_settings(); + + // Save the default values + $this->set_settings_defaults( $options ); + + // Display the settings page only if it has registered options + if( $options ){ + add_options_page( + __( 'Eventbrite Settings', 'eventbrite-api' ), + __( 'Eventbrite Settings', 'eventbrite-api' ), + 'manage_options', + 'eventbrite-api', + array( $this, 'display_settings_page') + ); + } + } + + /** + * Save the default values for the settings page + * + * @access public + * + * @param array $options Array of options + */ + public function set_settings_defaults( $options ){ + + // Abort if options are empty or is not an array + if( empty( $options ) || !is_array( $options ) ){ + return; + } + + foreach( $options as $name => $option ){ + if( isset( $option['default'] ) && get_option( 'eb_settings_' . $name ) === false ){ + update_option( 'eb_settings_' . $name, $option['default'] ); + } + } + } + + /** + * Display the main settings page + * + * @access public + * + */ + public function display_settings_page(){ + include_once( 'admin/settings-page.php' ); + } + + /** + * Get settings + * + * @access public + * @return array + */ + public function get_settings(){ + $options = apply_filters( 'eventbrite-admin-options', array() ); + if( !is_array( $options ) ){ + $options = array(); + } + return $options; + } + + /** + * Get settings option values + * + * @access public + * + * @param array $options Array of settings options + * @return array Array of values + */ + public function get_setting_values(){ + $options = $this->get_settings(); + $values = array(); + foreach( $options as $name => $option ){ + $value = get_option( 'eb_settings_' . $name ); + if( isset( $option['default'] ) && $value === false ){ + $value = $option['default']; + } + $values[$name] = $value; + } + return $values; + } + + + /** + * Save settings on form submission + * + * @access public + * + */ + public function save_settings(){ + // Abort if current section doesn't support this function + if( !function_exists( 'get_current_screen' ) ){ + return; + } + $screen = get_current_screen(); + + // Check if current screen is the eventbrite api settings page and if the form was submitted + if( $screen->id == 'settings_page_eventbrite-api' && !empty( $_POST['eb_save_settings'] ) ){ + $options = $this->get_settings(); + foreach( $options as $name => $option ){ + $value = ''; + + // Set the default value + if( isset( $option['default'] ) && $value === false ){ + $value = $option['default']; + } + + // Set the POST value if exists + if( isset( $_POST[$name] ) ){ + $value = $_POST[$name]; + } + + // Sanitize value + if( $option['type'] == 'text' ){ + $value = sanitize_text_field( $value ); + } + if( $option['type'] == 'boolean' ){ + $value = (boolean)$value; + } + + // Save value + update_option( 'eb_settings_' . $name, $value ); + + // Clean POST variables by redirecting to the same page + wp_redirect( '?page=eventbrite-api' ); + } + } + } + + /** + * Add admin options + * @param array $options + * @return array + */ + public function admin_options( $options ){ + $options['show_private_events'] = array( + 'name' => __( 'Show Private Events', 'eventbrite-api' ), + 'default' => false, + 'type' => 'boolean' + ); + return $options; + } + } + + new Eventbrite_Admin(); diff --git a/inc/class-eventbrite-api.php b/inc/class-eventbrite-api.php index 4f25302..885d1a1 100644 --- a/inc/class-eventbrite-api.php +++ b/inc/class-eventbrite-api.php @@ -64,9 +64,12 @@ private function define_endpoints() { if ( empty( $token ) ) return; - $this->set_endpoint( 'user_owned_events', self::API_BASE . 'users/' . $this->eventbrite_external_id . '/owned_events', 'GET' ); + $this->set_endpoint( 'user_events', self::API_BASE . 'users/' . $this->eventbrite_external_id . '/events', 'GET' ); $this->set_endpoint( 'event_details', self::API_BASE . 'events/', 'GET' ); - $this->set_endpoint( 'event_search', self::API_BASE . 'events/search/', 'GET' ); + $this->set_endpoint( 'event_search', self::API_BASE . 'organizers/:organizer_id/events/', 'GET' ); + $this->set_endpoint( 'get_webhooks', self::API_BASE . 'webhooks/', 'GET' ); + $this->set_endpoint( 'create_webhook', self::API_BASE . 'webhooks/', 'POST' ); + $this->set_endpoint( 'remove_webhook', self::API_BASE . 'webhooks/', 'DELETE' ); } /** @@ -85,9 +88,22 @@ public static function call( $endpoint, $query_params = array(), $object_id = nu return new Keyring_Error( '400', 'No token present for the Eventbrite API.' ); $endpoint_url = trailingslashit( self::$instance->{$endpoint . '_url'} ); + + // Check for ids in endpoint_url's and replace them. Required for organizers. + preg_match( '/\:([a-z\_]+)\//', $endpoint_url, $matches ); + if( !empty( $matches[1] )){ + if( ! empty( $query_params[ $matches[1] ] ) ){ + $endpoint_url = str_replace( ':' . $matches[1], $query_params[ $matches[1] ], $endpoint_url ); + unset( $query_params[ $matches[1] ] ); + }else{ + return new WP_Error( '500', 'Parameter "' . $matches[1] . '" is missing.' ); + } + } + $query_params['expand'] = apply_filters( 'eventbrite_api_expansions', 'logo,organizer,venue,ticket_classes,format,category,subcategory', $endpoint, $query_params, $object_id ); + $method = self::$instance->{$endpoint . '_method'}; - $params = array( 'method' => $method ); + $params = array( 'method' => $method, 'timeout' => 30 ); if ( ! empty( $object_id ) && is_numeric( $object_id ) ) { $endpoint_url = trailingslashit( $endpoint_url . absint( $object_id ) ); @@ -97,6 +113,8 @@ public static function call( $endpoint, $query_params = array(), $object_id = nu $endpoint_url = add_query_arg( $query_params, $endpoint_url ); } else if ( 'POST' == $method ) { $params['body'] = $query_params; + } else if ( 'DELETE' == $method ) { + $endpoint_url = $endpoint_url . '/' . $query_params['id']; } else { return new WP_Error( '500', 'Method ' . $method . ' is not implemented in the Eventbrite API.' ); } diff --git a/inc/class-eventbrite-calendar.php b/inc/class-eventbrite-calendar.php new file mode 100644 index 0000000..81b91da --- /dev/null +++ b/inc/class-eventbrite-calendar.php @@ -0,0 +1,278 @@ + $temp_event['post_date'], + "title" => substr( $temp_event['post_title'], 0, 20 ), + "url" => $url, + "status" => $event_status, + "status_class" => sanitize_title( $sale_status ), + "event_image" => $image_url + ); + + $event_holder[$date_index] = $temp; + } + + return $event_holder; + } + + + /** + * Function to get information about events for calendar + * Outputs json format + * + * @access public + */ + public function get_eventbrite_events( $query ) { + + $paged = 1; + + // Reset some query variables if set + if( isset( $query['nopaging'] ) ){ + $query['nopaging'] = false; + } + $query['paged'] = $paged; + + // Make the query + $events = new Eventbrite_Query( apply_filters( 'eventbrite_query_args', $query ) ); + $max_num_pages = $events->max_num_pages; + + $all_events = $this->format_eventbrite_data( $events ); + $paged++; + + while( $paged <= $max_num_pages ){ + $query['paged'] = $paged; + + $events = new Eventbrite_Query( apply_filters( 'eventbrite_query_args', $query ) ); + if( $events->post_count <= 0 ){ + break; + } + + $events = $this->format_eventbrite_data( $events ); + $all_events = array_merge( $all_events, $events ); + + if( count( $all_events ) >= 200 ){ + break; + } + $paged++; + } + + //Remove Duplicates + $final_events = array(); + $loop_counter = 0; + + foreach($all_events as $key=>$value){ + $final_events[$loop_counter] = $value; + $loop_counter++; + } + + return $final_events; + } + + + /** + * Display calendar data and html + * + * @access public + * + * @param object $query Eventbrite_Query object + * @return void Outputs HTML + */ + public function display_calendar( $query ) { + // Enqueue necessary assets + $this->enqueue_scripts(); + + // Display calendar template HTML + $template = $this->display_calendar_template(); + $template = apply_filters( 'eventbrite_calendar_template', $template ); + echo $template; + + // Save events data in a variable for javascript processing + ?> + + +
+ +
+ post_type = 'eb-custom-event'; + $this->post_name_singular = __( 'Custom Event', 'eventbrite-api' ); + $this->post_name_plural = __( 'Custom Events', 'eventbrite-api' ); + + $this->organizer_taxonomy = 'eb-organizer'; + $this->organizer_taxonomy_singular = __( 'Organizer', 'eventbrite-api' ); + $this->organizer_taxonomy_plural = __( 'Organizers', 'eventbrite-api' ); + + $this->venue_taxonomy = 'eb-venue'; + $this->venue_taxonomy_singular = __( 'Venue', 'eventbrite-api' ); + $this->venue_taxonomy_plural = __( 'Venues', 'eventbrite-api' ); + + + // Add admin settings + add_action( 'eventbrite-admin-options', array( $this, 'admin_options' ) ); + + // Save setting to flush rewrite rules if the custom events are enabled or disabled + add_action( 'add_option_eb_settings_enable_custom_events', array( $this, 'flush_rules' ), 10, 2 ); + add_action( 'update_option_eb_settings_enable_custom_events', array( $this, 'flush_rules' ), 10, 2 ); + + // Flush rules if setting was set + if( eventbrite_get_setting( 'flush_rules' ) ){ + flush_rewrite_rules( true ); + eventbrite_set_setting( 'flush_rules', false ); + } + + // If the custom events are disabled then abort + if( ! eventbrite_get_setting( 'enable_custom_events' ) ){ + return; + } + + // Register new post type to display custom events + $this->register_post_type(); + + // Register custom taxonomies + $this->register_custom_taxonomies(); + + if( is_admin() ){ + //Add a meta box where to display additional fields for the new post type + add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) ); + + // Save values for custom fields + add_action( 'save_post', array( $this, 'save_field_values' ), 10, 2 ); + } + + // Add custom events to Eventbrite results + add_filter( 'eventbrite_query_post_api_filters_after', array( $this, 'add_custom_events_to_results' ), 10, 2 ); + + // Filter events based on custom taxonomies + add_filter( 'eventbrite_query_post_api_filters_after', array( $this, 'filter_events' ), 10, 2 ); + + // Remove ticket widget from custom events + add_filter( 'eventbrite_ticket_form_widget', array( $this, 'remove_ticket_form_widget' ), 11, 2 ); + + // Add call to action for custom events + add_filter( 'eventbrite_ticket_form_widget', array( $this, 'add_call_to_action' ), 12, 2 ); + + // Add link to thumbnail of custom events + add_filter( 'post_thumbnail_html', array( $this, 'filter_event_logo' ), 9, 2 ); + + // Set custom template for custom events post type + add_filter( 'template_include', array( $this, 'display_template' ), 11, 2 ); + + // Set custom classes for custom event post type + add_filter( 'post_class', array( $this, 'filter_post_classes' ) ); + + // Change venue link with customm taxnomy link + add_filter( 'eventbrite_venue_get_archive_link', array( $this, 'venue_url' ) ); + + // Change organizer link with customm taxnomy link + add_filter( 'author_link', array( $this, 'organizer_url' ), 11, 2 ); + } + + /** + * Save setting to flush rewrite rules if the custom events are enabled or disabled + * + * @access public + * + * @param string $option The name of the option + * @param mixed $value The value of the option + */ + public function flush_rules( $option, $value ){ + eventbrite_set_setting( 'flush_rules', true ); + } + + /** + * Register new post type to display custom events + * + * @access public + */ + public function register_post_type() { + register_post_type( $this->post_type, + array( + 'labels' => array( + 'name' => $this->post_name_plural, + 'singular_name' => $this->post_name_singular, + 'add_new' => __( 'Add New', 'eventbrite-api' ), + 'add_new_item' => sprintf( __( 'Add New %s', 'eventbrite-api' ), $this->post_name_singular ), + 'edit' => __( 'Edit', 'eventbrite-api' ), + 'edit_item' => sprintf( __( 'Edit %s', 'eventbrite-api' ), $this->post_name_singular ), + 'new_item' => sprintf( __( 'New %s', 'eventbrite-api' ), $this->post_name_singular ), + 'view' => __( 'View', 'eventbrite-api' ), + 'view_item' => sprintf( __( 'View %s', 'eventbrite-api' ), $this->post_name_singular ), + 'search_items' => sprintf( __( 'Search %s', 'eventbrite-api' ), $this->post_name_plural ), + 'not_found' => sprintf( __( 'No %s found', 'eventbrite-api' ), $this->post_name_plural ), + 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'eventbrite-api' ), $this->post_name_plural ), + 'parent' => sprintf( __( 'Parent %s', 'eventbrite-api' ), $this->post_name_singular ), + ), + + 'menu_position' => 15, + 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions' ), + 'taxonomies' => array( '' ), + 'menu_icon' => 'dashicons-calendar', + 'has_archive' => false, + 'public' => false, + 'show_ui' => true, + 'show_in_menu' => true, + 'show_in_nav_menus' => false, + 'show_in_admin_bar' => false, + 'can_export' => true, + 'has_archive' => false, + 'exclude_from_search' => true, + 'publicly_queryable' => true, + 'rewrite' => array( 'slug' => 'event' ) + ) + ); + } + + /** + * Register new taxonomies + * + * @access public + */ + public function register_custom_taxonomies() { + + // Register the organizer taxonomy + register_taxonomy( + $this->organizer_taxonomy, + $this->post_type, + array( + 'labels' => array( + 'name' => $this->organizer_taxonomy_plural, + 'singular_name' => $this->organizer_taxonomy_singular, + 'search_items' => sprintf( __( 'Search %s', 'eventbrite-api' ), $this->organizer_taxonomy_plural ), + 'all_items' => sprintf( __( 'All %s', 'eventbrite-api' ), $this->organizer_taxonomy_plural ), + 'parent_item' => sprintf( __( 'Parent %s', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'parent_item_colon' => sprintf( __( 'Parent %s:', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'edit_item' => sprintf( __( 'Edit %s', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'update_item' => sprintf( __( 'Update %s', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'add_new_item' => sprintf( __( 'Add New %s', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'new_item_name' => sprintf( __( 'New %s Name', 'eventbrite-api' ), $this->organizer_taxonomy_singular ), + 'menu_name' => $this->organizer_taxonomy_singular, + ), + + 'hierarchical' => false, + 'show_ui' => true, + 'show_admin_column' => true, + 'query_var' => true, + 'rewrite' => array( 'slug' => 'organizer' ), + ) + ); + + + // Register the venue taxonomy + register_taxonomy( + $this->venue_taxonomy, + $this->post_type, + array( + 'labels' => array( + 'name' => $this->venue_taxonomy_plural, + 'singular_name' => $this->venue_taxonomy_singular, + 'search_items' => sprintf( __( 'Search %s', 'eventbrite-api' ), $this->venue_taxonomy_plural ), + 'all_items' => sprintf( __( 'All %s', 'eventbrite-api' ), $this->venue_taxonomy_plural ), + 'parent_item' => sprintf( __( 'Parent %s', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'parent_item_colon' => sprintf( __( 'Parent %s:', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'edit_item' => sprintf( __( 'Edit %s', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'update_item' => sprintf( __( 'Update %s', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'add_new_item' => sprintf( __( 'Add New %s', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'new_item_name' => sprintf( __( 'New %s Name', 'eventbrite-api' ), $this->venue_taxonomy_singular ), + 'menu_name' => $this->venue_taxonomy_singular, + ), + + 'hierarchical' => false, + 'show_ui' => true, + 'show_admin_column' => true, + 'query_var' => true, + 'rewrite' => array( 'slug' => 'venue' ), + ) + ); + } + + + /** + * Add a meta box where to display additional fields for the new post type + * + * @access public + */ + public function add_meta_box(){ + add_meta_box( $this->post_type . '_fields', + __( 'Event Details', 'eventbrite-api' ), + array( $this, 'display_fields' ), + $this->post_type, 'normal', 'high' + ); + } + + + /** + * Display custom fields + * + * @access public + * + * @param object $event Event post object + * @return void + */ + public function display_fields( $event ){ + + $defaults = array( + 'eb_event_start_date' => date( 'Y-m-d', strtotime( '+1 day' ) ), + 'eb_event_start_time' => '', + 'eb_event_end_date' => '', + 'eb_event_end_time' => '', + 'eb_event_url' => '', + ); + + $values = $this->get_field_values( $event->ID, $defaults ); + require 'admin/custom-event-metabox.php'; + } + + + /** + * Get values from post meta base on an array. + * + * @access public + * + * @param int $pid Post ID + * @param array $fields Array of meta keys and default values + * @return array + */ + public function get_field_values( $pid, $fields ){ + foreach( $fields as $meta_key => $default ){ + // Add meta value to array only if it has a value, else keep the default value + if( get_post_meta( $pid, $meta_key, true ) ){ + $fields[ $meta_key ] = get_post_meta( $pid, $meta_key, true ); + } + } + return $fields; + } + + + /** + * Save custom field values + * + * @access public + * + * @param int] $event_id Event post ID + * @param object $event Event post object + * @return void + */ + public function save_field_values( $event_id, $event ) { + // Check post type for Other Events + if ( $event->post_type == $this->post_type ) { + + // Add all key to an array for easier validation and manipulation + $keys = array( + 'eb_event_url', + 'eb_event_start_date', + 'eb_event_start_time', + 'eb_event_end_date', + 'eb_event_end_time', + ); + + // Add all values from POST + $values = array(); + foreach( $keys as $key ){ + if( isset( $_POST[ $key ] ) ){ + $values[ $key ] = stripslashes_deep( (string)$_POST[ $key ] ); + }else{ + $values[ $key ] = ''; + } + } + + // Sanitize the user inputs before saving + $this->sanitize_values( $values ); + + // Save the values + foreach( $values as $key => $value ){ + update_post_meta( $event_id, $key, $value ); + } + } + } + + + /** + * Sanitize the user inputs before saving + * + * @access public + * + * @param array $values Array of values + * @return array The sanitized array + */ + public function sanitize_values( $values ){ + foreach( $values as $key => $value ){ + if( ! $value ){ + continue; + } + + if( $key == 'eb_event_url' ){ + if( !filter_var ( $value, FILTER_SANITIZE_URL) ){ + $values[ $key ] = ''; + } + } + + if( $key == 'eb_event_start_date' ){ + $values[ $key ] = date( 'Y-m-d', strtotime( $value ) ); + } + + if( $key == 'eb_event_start_time' ){ + $values[ $key ] = date( 'H:i', strtotime( date( 'Y-m-d ' ) . $value . ':00' ) ); + } + + if( $key == 'eb_event_end_date' ){ + $values[ $key ] = date( 'Y-m-d', strtotime( $value ) ); + } + + if( $key == 'eb_event_end_time' ){ + $values[ $key ] = date( 'H:i', strtotime( date( 'Y-m-d ' ) . $value . ':00' ) ); + } + + if( $key == 'eb_event_organizer' || $key == 'eb_event_venue' ){ + $values[ $key ] = sanitize_text_field( $value ); + } + } + return $value; + } + + + /** + * Add custom events to the Eventbrite events result. + * + * @access public + * + * @param object $query api_results object + * @param object $object WP_Query object + * @return void + */ + public function add_custom_events_to_results( $results, $object ){//global $wp_query; print_r($wp_query);exit(); + + // Abort if the query is for a single event + if( !empty( $object->query['p'] ) ){ + return $results; + } + + // Abort if certain filters are applied + // This can be bypassed by adding the query variable: allow_custom_events + if( empty( $object->query['allow_custom_events'] ) && ( !empty( $object->query['venue_id'] ) || !empty( $object->query['category_id'] ) || !empty( $object->query['subcategory_id'] ) || !empty( $object->query['format_id'] ) ) ){ + return $results; + } + + // Abort if user has set custom events to be disallowed for this query + if( !empty( $object->query['disallow_custom_events'] ) ){ + return $results; + } + + $query = array( + 'post_type' => $this->post_type, + 'posts_per_page' => -1, + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => 'eb_event_start_date', + 'value' => date( 'Y-m-d' ), + 'compare' => '>=', + 'type' => 'date' + ), + array( + 'key' => 'eb_event_end_date', + 'value' => date( 'Y-m-d' ), + 'compare' => '>=', + 'type' => 'date' + ) + ) + ); + + if( get_post_type() == $this->post_type ){ + $query['p'] = get_the_ID(); + } + + // Query existing custom events that are today or in the future + $events = new WP_Query( $query ); + + // We need the filter for displaying content + if( ! has_filter( 'the_contnet', 'wpautop' ) ){ + add_filter( 'the_content', 'wpautop' ); + } + + + // Add events + foreach( $events->posts as $event ){ + + // Apply the_content filter to the content as eventbrite-api listings expects it to have paragraphs + $event->post_content = apply_filters( 'the_content', $event->post_content ); + + // Get the start date + $start_date = ''; + if( get_post_meta( $event->ID, 'eb_event_start_date', true ) && get_post_meta( $event->ID, 'eb_event_start_time', true ) ){ + $start_date = get_post_meta( $event->ID, 'eb_event_start_date', true ) . " " . get_post_meta( $event->ID, 'eb_event_start_time', true ) . ':00'; + } else if( get_post_meta( $event->ID, 'eb_event_start_date', true ) ){ + $start_date = get_post_meta( $event->ID, 'eb_event_start_date', true ); + } + + // Get the end date + $end_date = ''; + if( get_post_meta( $event->ID, 'eb_event_end_date', true ) && get_post_meta( $event->ID, 'eb_event_end_time', true ) ){ + $end_date = get_post_meta( $event->ID, 'eb_event_end_date', true ) . " " . get_post_meta( $event->ID, 'eb_event_end_time', true ) . ':00'; + } else if( get_post_meta( $event->ID, 'eb_event_end_date', true ) ){ + $end_date = get_post_meta( $event->ID, 'eb_event_end_date', true ); + } + + // Show the event only if it has a date set + if( $start_date ){ + $event->post_date = date( 'Y-m-d\TH:i:s', strtotime( $start_date ) ); + $event->post_date_gmt = date( 'Y-m-d\TH:i:s\z', strtotime( $start_date ) ); + $event->start = (object) array( + 'timezone' => date_default_timezone_get(), + 'local' => $event->post_date, + 'utc' => $event->post_date_gmt + ); + + if( $end_date ){ + $event->end = (object) array( + 'timezone' => date_default_timezone_get(), + 'local' => date( 'Y-m-d\TH:i:s', strtotime( $end_date ) ), + 'utc' => date( 'Y-m-d\TH:i:s\z', strtotime( $end_date ) ) + ); + }else{ + $event->end = (object) array( + 'timezone' => date_default_timezone_get(), + 'local' => $event->post_date, + 'utc' => $event->post_date_gmt + ); + } + + $event->url = get_post_meta( $event->ID, 'eb_event_url', true ); + $event->logo_url = get_the_post_thumbnail_url( $event->ID, 'eventbrite-event' ); + $event->category = get_post_meta( $event->ID, 'eb_event_category', true ); + $event->public = 1; + + // Add organizer info + $organizers = wp_get_post_terms( $event->ID, $this->organizer_taxonomy ); + $organizer = reset( $organizers ); + if( $organizer ){ + $event->organizer = (object) array( + 'description' => (object) array( + 'text' => '', + 'html' => '' + ), + 'long_description' => (object) array( + 'text' => '', + 'html' => '' + ), + 'logo' => '', + 'resource_url' => '', + 'id' => $organizer->name, + 'name' => $organizer->name, + 'url' => '', + 'vanity_url' => '', + 'num_past_events' => 0, + 'num_future_events' => 0, + 'logo_id' => '' + ); + } + + // Add venue info + $venues = wp_get_post_terms( $event->ID, $this->venue_taxonomy ); + $venue = reset( $venues ); + if( $venue ){ + $event->venue = (object) array( + 'address' => (object) array(), + 'long_description' => (object) array( + 'text' => '', + 'html' => '' + ), + 'resource_url' => '', + 'id' => '', + 'name' => $venue->name, + 'latitude' => 0, + 'longitute' => 0 + ); + } + + $results->events[] = $event; + } + } + + // Order events by date ascending + usort( $results->events, function( $a, $b ){ + return strtotime( $a->post_date ) > strtotime( $b->post_date ); + } ); + + return $results; + } + + + + public function filter_events( $results, $object ){ + + // Filter events by organizer taxonomy + if( is_tax( $this->organizer_taxonomy ) ){ + $object = get_queried_object(); + foreach( $results->events as $index => $event ){ + if( $event->organizer->name != $object->name ){ + unset( $results->events[ $index ] ); + } + } + } + + // Filter events by venue taxonomy + if( is_tax( $this->venue_taxonomy ) ){ + $object = get_queried_object(); + foreach( $results->events as $index => $event ){ + if( $event->venue->name != $object->name ){ + unset( $results->events[ $index ] ); + } + } + } + + // Filter out specified IDs: 'post__not_in' + if ( isset( $object->query['post__not_in'] ) && is_array( $object->query['post__not_in'] ) ) { + foreach( $results->events as $index => $event ){ + if( in_array( $event->id, $object->query['post__not_in'] ) ){ + unset( $results->events[ $index ] ); + } + } + } + + return $results; + } + + + /** + * Remove ticket form widget from custom events and display the excerpt + * + * @access public + * + * @param string $ticket_html HTML containing the form + * @param array $src Options used to generate the html + * @return string + */ + public function remove_ticket_form_widget( $ticket_html, $src ){ + if( get_post_type() == $this->post_type ){ + if( is_single() ){ + $ticket_html = ""; + }else{ + $ticket_html = wpautop( get_the_excerpt() ); + } + } + return $ticket_html; + } + + + /** + * Add call to action for custom event listings + * + * @access public + * + * @param string $ticket_html HTML containing the form + * @param array $src Options used to generate the html + * @return string + */ + public function add_call_to_action( $ticket_html, $src ){ + // Proceed only if the url is defined + if( get_post_meta( get_the_ID(), 'eb_event_url', true ) ){ + $label = __( 'Tickets', 'eventbrite-api' ); + $url = get_post_meta( get_the_ID(), 'eb_event_url', true ); + + // Allow option to change label + $label = apply_filters( 'eventbrite_custom_events_call_to_action_label', $label ); + + // Allow option to change url + $url = apply_filters( 'eventbrite_custom_events_call_to_action_url', $url ); + + // Add the button + $ticket_html .= sprintf( + '

%2$s

', + $url, + $label + ); + } + return $ticket_html; + } + + /** + * Replace featured images with the Eventbrite event logo. + * + * @access public + * + * @param string $html Original unfiltered HTML for a featured image. + * @param int $post_id The current event ID. + * @return string HTML tag for the Eventbrite logo linked to the event single view. + */ + public function filter_event_logo( $html, $post_id ){ + // Are we dealing with an Eventbrite custom event? + if ( !empty( $this->post_type ) && get_post_type( $post_id ) == $this->post_type ) { + // Does the event have a logo set? + if ( $html ) { + // No need for a permalink on event single views. + if ( !is_single() ) { + $html = sprintf( '%2$s', + esc_url( get_the_permalink() ), + $html + ); + } + } + } + return $html; + } + + + /** + * If current page is single and is this post type then display it on the eventbrite-api single template + * + * @access public + * + * @param boolean $display If returns true then the eventbrite-api single template will be used + * @return boolean + */ + public function display_template( $template ){ + if ( is_single() && get_post_type() == $this->post_type ) { + // Display template only if a custom single template isn't available + if( basename( $template ) != 'single-' . $this->post_type . '.php' ){ + $template = Eventbrite_Templates::get_default_template_path( 'eventbrite-single' ); + } + } + + if ( is_tax( $this->organizer_taxonomy ) ) { + // Display template only if a custom single template isn't available + if( basename( $template ) != 'archive-' . $this->organizer_taxonomy . '.php' ){ + $template = Eventbrite_Templates::get_default_template_path( 'eventbrite-archive' ); + } + } + if ( is_tax( $this->venue_taxonomy ) ) { + // Display template only if a custom single template isn't available + if( basename( $template ) != 'archive-' . $this->venue_taxonomy . '.php' ){ + $template = Eventbrite_Templates::get_default_template_path( 'eventbrite-archive' ); + } + } + return $template; + } + + + /** + * Adjust classes for Event
s. + * + * @access public + * + * @param array $classes Unfiltered post classes + * @return array Filtered post classes + */ + public function filter_post_classes( $classes ) { + if ( get_post_type() == $this->post_type ) { + $classes[] = 'eventbrite-event'; + + if ( ! empty( get_post()->logo_url ) ) { + $classes[] = 'has-post-thumbnail'; + } + } + + return $classes; + } + + + /** + * Replace venue url with custom taxnomy url + * + * @access public + * + * @param string $url The original venue url + * @return string The new url + */ + public function venue_url( $url ){ + if( get_post_type() === $this->post_type ){ + $venues = wp_get_post_terms( get_the_ID(), $this->venue_taxonomy ); + $venue = reset( $venues ); + if( $venue ){ + $url = get_term_link( $venue ); + } + } + return $url; + } + + /** + * Replace organizer url with custom taxnomy url + * + * @access public + * + * @param string $url The original venue url + * @return string The new url + */ + public function organizer_url( $url, $uid ){ + // Replace only for empty user IDs and in the custom post type + if( get_post_type() === $this->post_type && !$uid ){ + $organizers = wp_get_post_terms( get_the_ID(), $this->organizer_taxonomy ); + $organizer = reset( $organizers ); + if( $organizer ){ + $url = get_term_link( $organizer ); + } + } + return $url; + } + + /** + * Add admin settings for custom events + * + * @access public + * + * @param array $options Array of options + * @return array + */ + public function admin_options( $options ){ + $options['enable_custom_events'] = array( + 'name' => __( 'Enable Custom Events', 'eventbrite-api' ), + 'default' => true, + 'type' => 'boolean' + ); + return $options; + } + } + + new Eventbrite_Custom_Events(); diff --git a/inc/class-eventbrite-event.php b/inc/class-eventbrite-event.php old mode 100644 new mode 100755 diff --git a/inc/class-eventbrite-manager.php b/inc/class-eventbrite-manager.php index a0c2b8b..f0a0620 100644 --- a/inc/class-eventbrite-manager.php +++ b/inc/class-eventbrite-manager.php @@ -156,31 +156,31 @@ public function do_event_search( $params = array(), $force = false ) { return $results; } - /** - * Get user-owned private and public events. - * - * @access public - * - * @param array $params Parameters to be passed during the API call. - * @param bool $force Force a fresh API call, ignoring any existing transient. - * @return object Eventbrite_Manager - */ - public function get_user_owned_events( $params = array(), $force = false ) { - // Query for 'live' events by default (rather than 'all', which includes events in the past). - if ( ! isset( $params['status'] ) ) { - $params['status'] = 'live'; - } - - // Get the raw results. - $results = $this->request( 'user_owned_events', $params, false, $force ); - - // If we have events, map them to the format expected by Eventbrite_Event - if ( ! empty( $results->events ) ) { - $results->events = array_map( array( $this, 'map_event_keys' ), $results->events ); - } - - return $results; - } + /** + * Get user-owned private and public events. + * + * @access public + * + * @param array $params Parameters to be passed during the API call. + * @param bool $force Force a fresh API call, ignoring any existing transient. + * @return object Eventbrite_Manager + */ + public function get_user_events( $params = array(), $force = false ) { + // Query for 'live' events by default (rather than 'all', which includes events in the past). + if ( ! isset( $params['status'] ) ) { + $params['status'] = 'live'; + } + + // Get the raw results. + $results = $this->request( 'user_events', $params, false, $force ); + + // If we have events, map them to the format expected by Eventbrite_Event + if ( ! empty( $results->events ) ) { + $results->events = array_map( array( $this, 'map_event_keys' ), $results->events ); + } + + return $results; + } /** * Get a single event by ID. @@ -257,61 +257,28 @@ protected function get_transient_name( $endpoint, $params ) { */ protected function get_endpoint_params() { $params = array( - // http://developer.eventbrite.com/docs/event-search/ + // https://www.eventbrite.com/developer/v3/endpoints/organizers/ 'event_search' => array( - 'q' => array(), - 'since_id' => array(), - 'sort_by' => array( - 'id', - 'date', - 'name', - 'city', - ), - 'popular' => array( - true, - false, - ), - 'location.address' => array(), - 'location.latitude' => array(), - 'location.longitude' => array(), - 'location.within' => array(), - 'venue.city' => array(), - 'venue.region' => array(), - 'venue.country' => array(), - 'organizer.id' => array(), - 'user.id' => array(), - 'tracking_code' => array(), - 'categories' => array(), - 'formats' => array(), - 'start_date.range_start' => array(), - 'start_date.range_end' => array(), - 'start_date.keyword' => array( - 'today', - 'tomorrow', - 'this_week', - 'this_weekend', - 'next_week', - 'this_month', + 'organizer_id' => array(), + 'status' => array( + 'all', + 'canceled', + 'draft', + 'ended', + 'live', + 'started', ), - 'date_created.range_start' => array(), - 'date_created.range_end' => array(), - 'date_created.keyword' => array( - 'today', - 'tomorrow', - 'this_week', - 'this_weekend', - 'next_week', - 'this_month', + 'order_by' => array( + 'start_asc', + 'start_desc', + 'created_asc', + 'created_desc', ), - 'date_modified.range_start' => array(), - 'date_modified.range_end' => array(), - 'date_modified.keyword' => array( - 'today', - 'tomorrow', - 'this_week', - 'this_weekend', - 'next_week', - 'this_month', + 'start_date.range_start' => array(), + 'start_date.range_end' => array(), + 'only_public' => array( + true, + false ), ), // http://developer.eventbrite.com/docs/event-details/ @@ -320,10 +287,10 @@ protected function get_endpoint_params() { 'p' => array(), ), // http://developer.eventbrite.com/docs/user-owned-events/ - 'user_owned_events' => array( + 'user_events' => array( 'status' => array( 'all', - 'cancelled', + 'canceled', 'draft', 'ended', 'live', @@ -336,6 +303,16 @@ protected function get_endpoint_params() { 'created_desc', ), ), + // https://www.eventbrite.com/developer/v3/endpoints/webhooks/ + 'get_webhooks' => array(), + 'create_webhook' => array( + 'endpoint_url' => array(), + 'actions' => array(), + 'event_id' => array() + ), + 'remove_webhook' => array( + 'id' => array() + ) ); return $params; @@ -401,12 +378,25 @@ protected function register_transient( $transient_name ) { * @param string $service The Keyring service that has lost its connection. * @param string $request The Keyring action that's been called ("delete", not used). */ - public function flush_transients( $service, $request ) { + public static function flush_transients( $service, $request ) { // Bail if it wasn't an Eventbrite connection that got deleted. if ( 'eventbrite' != $service ) { return; } + // delete all transients + $this->delete_transients(); + + // Reset the list of registered transients. + delete_option( 'eventbrite_api_transients' ); + } + + /** + * Delete all transients. + * + * @access public + */ + public function delete_transients() { // Get the list of registered transients. $transients = get_option( 'eventbrite_api_transients', array() ); @@ -419,9 +409,6 @@ public function flush_transients( $service, $request ) { foreach ($transients as $transient ) { delete_transient( $transient ); } - - // Reset the list of registered transients. - delete_option( 'eventbrite_api_transients' ); } /** diff --git a/inc/class-eventbrite-query.php b/inc/class-eventbrite-query.php old mode 100644 new mode 100755 index 721651c..1104c3d --- a/inc/class-eventbrite-query.php +++ b/inc/class-eventbrite-query.php @@ -50,7 +50,7 @@ public function __construct( $query = '' ) { protected function process_query_args( $query ) { // Handle requests for paged events. $paged = get_query_var( 'paged' ); - if ( 2 <= $paged ) { + if ( 2 <= $paged && empty( $query['paged'] ) ) { $query['paged'] = $paged; } @@ -112,16 +112,42 @@ public function get_posts() { $this->api_results = eventbrite()->get_event( $this->query_vars['p'] ); } - // If private events are wanted, the user_owned_events endpoint must be used. - elseif ( isset( $this->query_vars['display_private'] ) && true === $this->query_vars['display_private'] ) { - $this->api_results = eventbrite()->get_user_owned_events( $params ); + //Compensate for the single post queries where the p value is missing + elseif ( empty( $this->query['p'] ) && isset( $this->query['p'] ) && is_single() ) { + } - // It's a run-of-the-mill query (only the user's public live events), meaning event_search is best. + // If private events are wanted, the events endpoint must be used. + elseif ( ! empty( $this->query_vars['display_private'] ) || eventbrite_get_setting( 'show_private_events' ) ) { + $this->api_results = eventbrite()->get_user_events( $params ); + } + + // If no organizer_id was given then show the events for the current user + elseif ( empty( $this->query_vars['organizer_id'] ) ) { + $this->api_results = eventbrite()->get_user_events( $params ); + } + + // It's a run-of-the-mill query (only the user's public live events) else { $this->api_results = eventbrite()->do_event_search( $params ); } + // Save the used parameters + $this->params = $params; + + // Set the default variables if no results + if( !is_wp_error( $this->api_results ) && empty( $this->api_results ) ){ + $this->api_results = (object)array( + 'events' => array(), + 'pagination' => (object) array( + 'object_count' => 0, + 'page_number' => 1, + 'page_size' => 0, + 'page_count' => 1, + ), + ); + } + // Do any post-API query processing. $this->post_api_filters(); @@ -150,24 +176,42 @@ protected function set_api_params() { $params['page'] = ceil( $this->query_vars['paged'] / 5 ); } - // We need the Eventbrite user ID (or an organizer) if we're getting only public events. - if ( ! isset( $this->query_vars['display_private'] ) || true !== $this->query_vars['display_private'] ) { - // Set sorting. - $params['sort_by'] = 'date'; - - // Set the user ID if we don't have a specified organizer. - if ( ! empty( $this->query_vars['organizer_id'] ) ) { - $params['organizer.id'] = (int) $this->query_vars['organizer_id']; - } else { - $params['user.id'] = Eventbrite_API::$instance->eventbrite_external_id; - } + // set the order + if( empty( $this->query_vars['order_by'] ) ){ + $params['order_by'] = 'start_asc'; + }else{ + $params['order_by'] = $this->query_vars['order_by']; } - // Adjust status for private events if necessary. - if ( isset( $this->query_vars['display_private'] ) && true === $this->query_vars['display_private'] && ! empty( $this->query_vars['status'] ) ) { + // set the status + if( !empty( $this->query_vars['status'] ) ){ $params['status'] = $this->query_vars['status']; } + // Set the these variables only if the organizer_id is specified + if( ! empty( $this->query_vars['organizer_id'] ) ){ + $params['organizer_id'] = (int) $this->query_vars['organizer_id']; + + if( empty( $this->query_vars['start_date'] ) ){ + if( empty( $params['status'] ) || $params['status'] == 'live' ){ + $params['start_date.range_start'] = date( "Y-m-d\T00:00:00" ); + } + }else{ + $params['start_date.range_start'] = date( "Y-m-d\T00:00:00", strtotime( $this->query_vars['start_date'] ) ); + } + + if( ! empty( $this->query_vars['end_date'] ) ){ + $params['start_date.range_end'] = date( "Y-m-d\T00:00:00", strtotime( $this->query_vars['end_date'] ) ); + } + + // Adjust status for private events if necessary. + if ( ! empty( $this->query_vars['display_private'] ) || eventbrite_get_setting( 'show_private_events' ) ) { + $params['only_public'] = false; + }else{ + $params['only_public'] = true; + } + } + return $params; } @@ -193,7 +237,11 @@ protected function set_properties() { else { $modulus = ( 2 <= $this->query_vars['paged'] && 0 == $this->query_vars['paged'] % 5 ) ? 5 : $this->query_vars['paged'] % 5; $offset = ( 2 <= $modulus && 5 >= $modulus ) ? ( $modulus - 1 ) * 10 : 0; - $this->posts = array_slice( $this->api_results->events, $offset, 10 ); + $max_offset = 10; + if( !empty( $this->query_vars['limit'] ) ){ + $max_offset = $this->query_vars['limit']; + } + $this->posts = array_slice( $this->api_results->events, $offset, $max_offset ); $posts_per_page = 10; } @@ -259,11 +307,13 @@ protected function create_eventbrite_event( $event = null ) { * @access protected */ protected function post_api_filters() { - // Do nothing if API results were empty, false, or an error. - if ( empty( $this->api_results ) || is_wp_error( $this->api_results ) ) { + // Do nothing if an error. + if (is_wp_error( $this->api_results ) ) { return false; } + $this->api_results = apply_filters( 'eventbrite_query_post_api_filters_before', $this->api_results, $this ); + // Filter out specified IDs: 'post__not_in' if ( isset( $this->query_vars['post__not_in'] ) && is_array( $this->query_vars['post__not_in'] ) ) { $this->api_results->events = array_filter( $this->api_results->events, array( $this, 'filter_by_post_not_in' ) ); @@ -298,6 +348,17 @@ protected function post_api_filters() { if ( isset( $this->query_vars['limit'] ) && is_integer( $this->query_vars['limit'] ) ) { $this->api_results->events = array_slice( $this->api_results->events, 0, absint( $this->query_vars['limit'] ) ); } + + // Remove private events + if ( empty( $this->query_vars['display_private'] ) && ! eventbrite_get_setting( 'show_private_events' ) ) { + $this->api_results->events = array_filter( $this->api_results->events, array( $this, 'filter_public' ) ); + } + + // Add filters support + $this->api_results = apply_filters( 'eventbrite_query_post_api_filters_after', $this->api_results, $this ); + + // Save results count after filters are applied + $this->api_results->pagination->object_count = count( $this->api_results->events ); } /** @@ -361,6 +422,18 @@ protected function filter_by_subcategory( $event ) { return ( isset( $event->subcategory->id ) ) ? $event->subcategory->id == $this->query_vars['subcategory_id'] : false; } + /** + * Filter to show only public events + * + * @access protected + * + * @param object $event A single event from the API call results. + * @return bool True if properties match, false otherwise. + */ + protected function filter_public( $event ) { + return ! empty( $event->public ); + } + /** * Determine if an event is part of a given format. * @@ -490,7 +563,10 @@ public function filter_author_url( $url ) { // If the event has an organizer set, append it to the URL. http://(page permalink)/organizer/(organizer name)-(organizer ID)/ if ( ! empty( eventbrite_event_organizer()->name ) ) { - $url .= 'organizer/' . sanitize_title( eventbrite_event_organizer()->name ) . '-' . absint( eventbrite_event_organizer()->id ); + $url .= 'organizer/' . sanitize_title( eventbrite_event_organizer()->name ); + if( !empty( eventbrite_event_organizer()->id ) ){ + $url .= '-' . absint( eventbrite_event_organizer()->id ); + } } } diff --git a/inc/class-eventbrite-requirements.php b/inc/class-eventbrite-requirements.php old mode 100644 new mode 100755 diff --git a/inc/class-eventbrite-templates.php b/inc/class-eventbrite-templates.php old mode 100644 new mode 100755 index 72e944d..9fd7acd --- a/inc/class-eventbrite-templates.php +++ b/inc/class-eventbrite-templates.php @@ -21,6 +21,9 @@ public function __construct() { add_action( 'body_class', array( $this, 'adjust_body_classes' ) ); add_action( 'save_post_page', array( $this, 'flush_rewrite_rules_on_save_post' ), 10, 2 ); add_action( 'updated_postmeta', array( $this, 'flush_rewrite_rules_on_updated_postmeta' ), 10, 3 ); + + // Register image size for eventbrite events + add_image_size( 'eventbrite-event', 400, 200, true ); } /** @@ -103,49 +106,45 @@ public function inject_page_template( $templates ) { */ public function check_templates( $template ) { // If we have an 'eventbrite_id' query var, we're dealing with an event single view. + // The filter allows custom post types to be displayed in the same template if ( get_query_var( 'eventbrite_id' ) ) { - // A default theme is being used; we've got special templates for those. - if ( $this->default_theme_activated() ) { - $template = plugin_dir_path( __DIR__ ) . 'tmpl/compat/' . get_template() . '/eventbrite-single.php'; - } - - // The theme declares support, look for an Eventbrite single template. - elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_stylesheet_directory() . '/eventbrite/eventbrite-single.php' ) ) { - $template = esc_url( get_stylesheet_directory() . '/eventbrite/eventbrite-single.php' ); - } - - // Oh, maybe the theme is a child theme; let's check the parent theme for a template too. - elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_template_directory() . '/eventbrite/eventbrite-single.php' ) ) { - $template = esc_url( get_template_directory() . '/eventbrite/eventbrite-single.php' ); - } - - // No template was found, and it's not a default theme, so use the one included with the plugin. - else { - $template = plugin_dir_path( __DIR__ ) . 'tmpl/eventbrite-single.php'; - } + $template = $this->get_default_template_path( 'eventbrite-single' ); } // Check if we have a page using the Eventbrite event listing template. + // The filter allows custom post types to be displayed in the same template elseif ( 'eventbrite-index.php' == get_post_meta( get_the_ID(), '_wp_page_template', true ) ) { - // We're using a default theme. We've got special template files for those. - if ( $this->default_theme_activated() ) { - $template = plugin_dir_path( __DIR__ ) . 'tmpl/compat/' . get_template() . '/eventbrite-index.php'; - } + $template = $this->get_default_template_path( 'eventbrite-index' ); + } - // The theme declares support, looks for an Eventbrite index template. - elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_stylesheet_directory() . '/eventbrite/eventbrite-index.php' ) ) { - $template = esc_url( get_stylesheet_directory() . '/eventbrite/eventbrite-index.php' ); - } + return $template; + } - // Let a child theme inherit its parent's index template. - elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_template_directory() . '/eventbrite/eventbrite-index.php' ) ) { - $template = esc_url( get_template_directory() . '/eventbrite/eventbrite-index.php' ); - } - // Nothing in the theme, and it's not a default theme; just use our regular template. - else { - $template = plugin_dir_path( __DIR__ ) . 'tmpl/eventbrite-index.php'; - } + /** + * Retrieves the default template path based on the template name + * @param string $template_name Name of file template + * @return string The path to the template with the template name + */ + public static function get_default_template_path( $template_name ){ + // We're using a default theme. We've got special template files for those. + if ( self::default_theme_activated() ) { + $template = plugin_dir_path( __DIR__ ) . 'tmpl/compat/' . get_template() . '/' . $template_name . '.php'; + } + + // The theme declares support, looks for an Eventbrite template. + elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_stylesheet_directory() . '/eventbrite/' . $template_name . '.php' ) ) { + $template = esc_url( get_stylesheet_directory() . '/eventbrite/' . $template_name . '.php' ); + } + + // Let a child theme inherit its parent's template. + elseif ( current_theme_supports( 'eventbrite' ) && file_exists( get_template_directory() . '/eventbrite/' . $template_name . '.php' ) ) { + $template = esc_url( get_template_directory() . '/eventbrite/' . $template_name . '.php' ); + } + + // Nothing in the theme, and it's not a default theme; just use our regular template. + else { + $template = plugin_dir_path( __DIR__ ) . 'tmpl/' . $template_name . '.php'; } return $template; @@ -157,13 +156,13 @@ public function check_templates( $template ) { * @access public */ public function enqueue_styles() { - // Bail if we're not using a default theme. + // If we're not using a default theme. if ( ! $this->default_theme_activated() ) { - return; + $style_rel_path = 'tmpl/eventbrite-style.css'; + }else{ + // If there's a stylesheet for this default theme, enqueue it. + $style_rel_path = 'tmpl/compat/' . get_template() . '/eventbrite-style.css'; } - - // If there's a stylesheet for this default theme, enqueue it. - $style_rel_path = 'tmpl/compat/' . get_template() . '/eventbrite-style.css'; if ( file_exists( plugin_dir_path( dirname( __FILE__ ) ) . $style_rel_path ) ) { wp_enqueue_style( 'eventbrite-styles', @@ -209,7 +208,7 @@ public function adjust_body_classes( $classes ) { * * @return bool True if a default theme is active, false otherwise. */ - protected function default_theme_activated() { + protected static function default_theme_activated() { // Our supported default themes. $default_themes = array( 'twentyten', diff --git a/inc/class-eventbrite-webhook.php b/inc/class-eventbrite-webhook.php new file mode 100644 index 0000000..47359d8 --- /dev/null +++ b/inc/class-eventbrite-webhook.php @@ -0,0 +1,109 @@ +webhook_param = 'eventbrite_webhook'; + $this->webhook_url = get_bloginfo( 'url' ) . '?' . $this->webhook_param; + + // Check to see if current page is called by Eventbrite + $this->check_for_webhook(); + + // Register hooks. + if( get_option( 'eventbrite_api_plugin_actived' ) ){ + $this->create_webhook(); + } + } + + /** + * Check to see if current page is called by Eventbrite + * + * @access private + */ + private function check_for_webhook() { + // check if webhook variable is present + if( isset( $_GET[ $this->webhook_param ] ) ){ + // delete all plugin cache + $this->delete_transients(); + + // confirmation message for webhook tests + echo 'Eventbrite API webhook is working'; + + // stop execution + exit(); + } + } + + /** + * If no webhook has been set up in Eventbrite then create one + * @return boolean Returns true if webhook has been setup + */ + public function create_webhook() { + if( !$this->is_webhook_created() ){ + $url = $this->webhook_url; + // There is a bug on Eventbrite where if you delete a webhook and try to created it again it will not create it. + // To solve this we are adding a string at the end with the current time to create a new endpoint + $url = $url . '#'. strtotime( 'now' ); + + $params = array( + 'endpoint_url' => $url, + 'actions' => 'event.published,event.updated,event.unpublished,order.placed' + ); + + $response = Eventbrite_Manager::$instance->request( 'create_webhook', $params ); + return is_object( $response ) && !empty( $response->id ); + } + + if( $this->is_webhook_created() ){ + return true; + } + } + + /** + * Check if webhook is created on Eventbrite + * @return boolean Returns true if webhook has been setup + */ + public function is_webhook_created() { + $response = Eventbrite_Manager::$instance->request( 'get_webhooks', array(), 0, true ); + if( $response && !is_wp_error( $response ) && isset( $response->webhooks ) ){ + foreach( $response->webhooks as $webhook ){ + $url = strstr( $webhook->endpoint_url, '#', true ); + if( $url == $this->webhook_url ){ + return $webhook->id; + } + } + } + } + + /** + * Remove webhook from Eventbrite + * @return boolean Returns true if webhook has been deleted + */ + public function remove_webhook() { + if( $id = $this->is_webhook_created() ){ + $response = Eventbrite_Manager::$instance->request( 'remove_webhook', array( 'id' => $id ), 0, true ); + if( !is_wp_error( $response ) && is_object( $response ) && isset( $response->success ) ){ + return $response->success; + } + } + } + } + +new Eventbrite_Webhook(); diff --git a/inc/functions.php b/inc/functions.php index cbb6369..b0d7923 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -9,12 +9,12 @@ /** * Get an array of Eventbrite events, in the format expected by Eventbrite_Event * - * @param array $params Parameters for the user_owned_events endpoint to pass during the API call. + * @param array $params Parameters for the user_events endpoint to pass during the API call. * @param bool $force Force an API call, don't use cache. * @return object API results */ function eventbrite_get_events( $params = array(), $force = false ) { - return eventbrite()->get_user_owned_events( $params, $force ); + return eventbrite()->get_user_events( $params, $force ); } endif; @@ -64,8 +64,8 @@ function eventbrite_is_event( $post = null ) { global $post; } - // Check if the post is an Eventbrite_Event object. - if ( is_a( $post, 'Eventbrite_Event' ) ) { + // Check if the post is an Eventbrite_Event object and if it doesn't have a post type set + if ( is_a( $post, 'Eventbrite_Event' ) && empty( $post->post_type ) ) { return true; } @@ -179,8 +179,8 @@ function eventbrite_event_meta() { 'class' => array(), ), ) ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - esc_html( get_the_author() ) + esc_url( get_author_posts_url( 0 ) ), + esc_html( eventbrite_event_organizer()->name ) ); } @@ -354,14 +354,20 @@ function eventbrite_event_end() { * @return string URL */ function eventbrite_venue_get_archive_link() { - // Get the permalink of the current template page. - $url = get_permalink( get_queried_object_id() ); + $url = ""; - // If the event has a venue set, append it to the URL. http://(page permalink)/venue/(venue name)-(venue ID)/ - if ( ! empty( eventbrite_event_venue()->name ) ) { - $url .= 'venue/' . sanitize_title( eventbrite_event_venue()->name ) . '-' . absint( eventbrite_event_venue()->id ); + if( !empty( eventbrite_event_venue()->id ) ){ + // Get the permalink of the current template page. + $url = get_permalink( get_queried_object_id() ); + + // If the event has a venue set, append it to the URL. http://(page permalink)/venue/(venue name)-(venue ID)/ + if ( ! empty( eventbrite_event_venue()->name ) ) { + $url .= 'venue/' . sanitize_title( eventbrite_event_venue()->name ) . '-' . absint( eventbrite_event_venue()->id ); + } } + $url = apply_filters( 'eventbrite_venue_get_archive_link', $url ); + return $url; } endif; @@ -386,6 +392,12 @@ function eventbrite_edit_post_link( $text = null, $before = '', $after = '' ) { 'ref' => 'wporgedit', ), 'https://eventbrite.com/edit' ); + + // If real post then return the post edit link + if( get_post_type() ){ + $url = get_edit_post_link(); + } + // Output the formatted link. printf( '%s%s%s', $before, @@ -404,7 +416,7 @@ function eventbrite_ticket_form_widget() { // Build the src attribute URL. $src = add_query_arg( array( 'eid' => get_the_ID(), - 'ref' => 'etckt', + 'ref' => 'odwdwdwordpress', ), '//eventbrite.com/tickets-external' ); // Assemble our ticket info HTML. @@ -441,9 +453,11 @@ function eventbrite_get_ticket_form_widget_height() { // Add height for each ticket type. $tickets_height += 85; // Note if any ticket types are still available. - if ( 'AVAILABLE' === $ticket->on_sale_status ) { + if ( 'AVAILABLE' === $ticket->on_sale_status && !empty( $ticket->sales_end ) ) { $sales_open = true; - $sales_end[] = $ticket->sales_end; + if( isset( $ticket->sales_end ) ){ + $sales_end[] = $ticket->sales_end; + } } } @@ -481,3 +495,36 @@ function eventbrite_get_ticket_form_widget_height() { function eventbrite_has_active_connection() { return ( Eventbrite_Requirements::has_active_connection() ); } + +if ( ! function_exists( 'eventbrite_show_calendar' ) ) : + /** + * Display calendar with events in html format + * @param array $query Query to use for event search + */ + function eventbrite_show_calendar( $query ){ + $calendar = new Eventrite_Calendar(); + $calendar->display_calendar( $query ); + } +endif; + +if ( ! function_exists( 'eventbrite_get_setting' ) ) : + /** + * Get an Eventbrite API administration setting + * @param string $key The key of the option + * @return mixed The value of the setting + */ + function eventbrite_get_setting( $key ){ + return get_option( 'eb_settings_' . $key ); + } +endif; + +if ( ! function_exists( 'eventbrite_set_setting' ) ) : + /** + * Save an Eventbrite API administration setting + * @param string $key The key of the option + * @param mixed The value of the setting + */ + function eventbrite_set_setting( $key, $value ){ + return update_option( 'eb_settings_' . $key, $value ); + } +endif; \ No newline at end of file diff --git a/readme.txt b/readme.txt old mode 100644 new mode 100755 index 3409f36..e3a4455 --- a/readme.txt +++ b/readme.txt @@ -72,7 +72,7 @@ Assuming your theme is based on [Underscores](http://underscores.me/), most of t The following endpoints are currently supported, with more on the way. Open an issue on GitHub to request support for others. -* `user_owned_events`: [Eventbrite documentation](http://developer.eventbrite.com/docs/user-owned-events/). +* `user_events`: [Eventbrite documentation](https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-events). * `event_details`: [Eventbrite documentation](http://developer.eventbrite.com/docs/event-details/). * `event_search`: [Eventbrite documentation](http://developer.eventbrite.com/docs/event-search/). diff --git a/tmpl/.DS_Store b/tmpl/.DS_Store new file mode 100644 index 0000000..366bf27 Binary files /dev/null and b/tmpl/.DS_Store differ diff --git a/tmpl/compat/.DS_Store b/tmpl/compat/.DS_Store new file mode 100644 index 0000000..fd98e12 Binary files /dev/null and b/tmpl/compat/.DS_Store differ diff --git a/tmpl/compat/twentyeleven/eventbrite-archive.php b/tmpl/compat/twentyeleven/eventbrite-archive.php new file mode 100755 index 0000000..09896fe --- /dev/null +++ b/tmpl/compat/twentyeleven/eventbrite-archive.php @@ -0,0 +1,78 @@ + + +
+
+ + + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + + +
+
+ + + diff --git a/tmpl/compat/twentyeleven/eventbrite-index.php b/tmpl/compat/twentyeleven/eventbrite-index.php old mode 100644 new mode 100755 index 026ac0e..95f75d4 --- a/tmpl/compat/twentyeleven/eventbrite-index.php +++ b/tmpl/compat/twentyeleven/eventbrite-index.php @@ -15,7 +15,7 @@ false, // boolean // 'nopaging' => false, // boolean // 'limit' => null, // integer @@ -26,43 +26,63 @@ // 'category_id' => null, // integer // 'subcategory_id' => null, // integer // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string ) ) ); + ?> + +
+ + +
- if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> +
+ ', '' ); ?> +
+
- + // Return $post to its rightful owner. + wp_reset_postdata(); + ?> + diff --git a/tmpl/compat/twentyeleven/eventbrite-single.php b/tmpl/compat/twentyeleven/eventbrite-single.php old mode 100644 new mode 100755 diff --git a/tmpl/compat/twentyeleven/eventbrite-style.css b/tmpl/compat/twentyeleven/eventbrite-style.css old mode 100644 new mode 100755 index 831c510..f96fc31 --- a/tmpl/compat/twentyeleven/eventbrite-style.css +++ b/tmpl/compat/twentyeleven/eventbrite-style.css @@ -26,4 +26,41 @@ .archive-eventbrite .nav-links .page-numbers { padding: 0 7px; +} + +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; } \ No newline at end of file diff --git a/tmpl/compat/twentyfifteen/.DS_Store b/tmpl/compat/twentyfifteen/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/tmpl/compat/twentyfifteen/.DS_Store differ diff --git a/tmpl/compat/twentyfifteen/eventbrite-archive.php b/tmpl/compat/twentyfifteen/eventbrite-archive.php new file mode 100755 index 0000000..5124ee9 --- /dev/null +++ b/tmpl/compat/twentyfifteen/eventbrite-archive.php @@ -0,0 +1,78 @@ + + +
+
+ + + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + +
+
+ + + diff --git a/tmpl/compat/twentyfifteen/eventbrite-index.php b/tmpl/compat/twentyfifteen/eventbrite-index.php old mode 100644 new mode 100755 index fc7a92e..4706414 --- a/tmpl/compat/twentyfifteen/eventbrite-index.php +++ b/tmpl/compat/twentyfifteen/eventbrite-index.php @@ -13,60 +13,76 @@ - false, // boolean - // 'nopaging' => false, // boolean - // 'limit' => null, // integer - // 'organizer_id' => null, // integer - // 'p' => null, // integer - // 'post__not_in' => null, // array of integers - // 'venue_id' => null, // integer - // 'category_id' => null, // integer - // 'subcategory_id' => null, // integer - // 'format_id' => null, // integer - ) ) ); - - if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> - - - - - + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + ?> + +
+ + +
+ +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + +
diff --git a/tmpl/compat/twentyfifteen/eventbrite-single.php b/tmpl/compat/twentyfifteen/eventbrite-single.php old mode 100644 new mode 100755 diff --git a/tmpl/compat/twentyfifteen/eventbrite-style.css b/tmpl/compat/twentyfifteen/eventbrite-style.css old mode 100644 new mode 100755 index e503d34..1cfb2c7 --- a/tmpl/compat/twentyfifteen/eventbrite-style.css +++ b/tmpl/compat/twentyfifteen/eventbrite-style.css @@ -73,6 +73,43 @@ margin-right: 1em; } +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; +} + @media screen and (min-width: 46.25em) { .eventbrite-event .entry-meta, .eventbrite-event .entry-meta a { diff --git a/tmpl/compat/twentyfourteen/eventbrite-archive.php b/tmpl/compat/twentyfourteen/eventbrite-archive.php new file mode 100755 index 0000000..e7700ce --- /dev/null +++ b/tmpl/compat/twentyfourteen/eventbrite-archive.php @@ -0,0 +1,82 @@ + + +
+
+
+ + + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + + +
+
+ +
+ + false, // boolean // 'nopaging' => false, // boolean // 'limit' => null, // integer @@ -27,45 +27,63 @@ // 'category_id' => null, // integer // 'subcategory_id' => null, // integer // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string ) ) ); - - if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> - - - - - + +
+ + +
+ +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + +
diff --git a/tmpl/compat/twentyfourteen/eventbrite-single.php b/tmpl/compat/twentyfourteen/eventbrite-single.php old mode 100644 new mode 100755 diff --git a/tmpl/compat/twentyfourteen/eventbrite-style.css b/tmpl/compat/twentyfourteen/eventbrite-style.css old mode 100644 new mode 100755 index 0e9e188..83ab994 --- a/tmpl/compat/twentyfourteen/eventbrite-style.css +++ b/tmpl/compat/twentyfourteen/eventbrite-style.css @@ -33,4 +33,50 @@ .eventbrite-event .sep { display: none; +} + +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; +} + +.eventbrite-event-list .nav-links { + text-align: center; +} + +@media( min-width: 670px ){ +.eventbrite-event-list { + margin-top: 100px; } \ No newline at end of file diff --git a/tmpl/compat/twentyten/eventbrite-archive.php b/tmpl/compat/twentyten/eventbrite-archive.php new file mode 100755 index 0000000..35b0a25 --- /dev/null +++ b/tmpl/compat/twentyten/eventbrite-archive.php @@ -0,0 +1,74 @@ + + +
+
+

+ +

+ + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + +
> +
+ +
+ + ', esc_url( get_permalink() ) ), '' ); ?> + + + +
+ +
+ +
+ ', '' ); ?> +
+
+ + +
+
+ + + diff --git a/tmpl/compat/twentyten/eventbrite-index.php b/tmpl/compat/twentyten/eventbrite-index.php old mode 100644 new mode 100755 index 1a85a6c..9125d65 --- a/tmpl/compat/twentyten/eventbrite-index.php +++ b/tmpl/compat/twentyten/eventbrite-index.php @@ -13,7 +13,7 @@ false, // boolean // 'nopaging' => false, // boolean // 'limit' => null, // integer @@ -24,41 +24,61 @@ // 'category_id' => null, // integer // 'subcategory_id' => null, // integer // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string ) ) ); + ?> - if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> +
+ + +
-
> - ', esc_url( get_permalink() ) ), '' ); ?> +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> +
> +
+ +
+ + ', esc_url( get_permalink() ) ), '' ); ?> - + -
- -
+
+ +
-
- ', '' ); ?> -
-
+
+ ', '' ); ?> +
+
- + // Return $post to its rightful owner. + wp_reset_postdata(); + ?> +
diff --git a/tmpl/compat/twentyten/eventbrite-single.php b/tmpl/compat/twentyten/eventbrite-single.php old mode 100644 new mode 100755 index cc63e8b..49db76c --- a/tmpl/compat/twentyten/eventbrite-single.php +++ b/tmpl/compat/twentyten/eventbrite-single.php @@ -20,6 +20,11 @@ + +
+ +
+
diff --git a/tmpl/compat/twentyten/eventbrite-style.css b/tmpl/compat/twentyten/eventbrite-style.css old mode 100644 new mode 100755 index 609d2b6..bc4efa5 --- a/tmpl/compat/twentyten/eventbrite-style.css +++ b/tmpl/compat/twentyten/eventbrite-style.css @@ -26,4 +26,46 @@ background-color: #f1f1f1; color: #000; font-weight: bold; +} + +.eventbrite-event-calendar .clndr-previous-button, +.eventbrite-event-calendar .clndr-next-button { + margin-top: 0px; +} + +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; } \ No newline at end of file diff --git a/tmpl/compat/twentythirteen/eventbrite-archive.php b/tmpl/compat/twentythirteen/eventbrite-archive.php new file mode 100755 index 0000000..5638a5e --- /dev/null +++ b/tmpl/compat/twentythirteen/eventbrite-archive.php @@ -0,0 +1,78 @@ + + +
+
+
+

+ +

+
+ + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + + +
+
+ + + diff --git a/tmpl/compat/twentythirteen/eventbrite-index.php b/tmpl/compat/twentythirteen/eventbrite-index.php old mode 100644 new mode 100755 index 0ea5b17..4c034e4 --- a/tmpl/compat/twentythirteen/eventbrite-index.php +++ b/tmpl/compat/twentythirteen/eventbrite-index.php @@ -15,7 +15,7 @@ false, // boolean // 'nopaging' => false, // boolean // 'limit' => null, // integer @@ -26,45 +26,62 @@ // 'category_id' => null, // integer // 'subcategory_id' => null, // integer // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string ) ) ); - - if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> - - - - + +
+ + +
+ +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + +
diff --git a/tmpl/compat/twentythirteen/eventbrite-single.php b/tmpl/compat/twentythirteen/eventbrite-single.php old mode 100644 new mode 100755 diff --git a/tmpl/compat/twentythirteen/eventbrite-style.css b/tmpl/compat/twentythirteen/eventbrite-style.css old mode 100644 new mode 100755 index 580d886..61215db --- a/tmpl/compat/twentythirteen/eventbrite-style.css +++ b/tmpl/compat/twentythirteen/eventbrite-style.css @@ -33,4 +33,42 @@ .eventbrite-event .sep { display: none; +} + + +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; } \ No newline at end of file diff --git a/tmpl/compat/twentytwelve/eventbrite-archive.php b/tmpl/compat/twentytwelve/eventbrite-archive.php new file mode 100755 index 0000000..7ec7374 --- /dev/null +++ b/tmpl/compat/twentytwelve/eventbrite-archive.php @@ -0,0 +1,76 @@ + + +
+
+
+

+ +

+
+ + false, // boolean + // 'nopaging' => false, // boolean + // 'limit' => null, // integer + // 'organizer_id' => null, // integer + // 'p' => null, // integer + // 'post__not_in' => null, // array of integers + // 'venue_id' => null, // integer + // 'category_id' => null, // integer + // 'subcategory_id' => null, // integer + // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string + ) ) ); + + if ( $events->have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + + +
+
+ + + diff --git a/tmpl/compat/twentytwelve/eventbrite-index.php b/tmpl/compat/twentytwelve/eventbrite-index.php old mode 100644 new mode 100755 index 935d3b6..f09d2de --- a/tmpl/compat/twentytwelve/eventbrite-index.php +++ b/tmpl/compat/twentytwelve/eventbrite-index.php @@ -15,7 +15,7 @@ false, // boolean // 'nopaging' => false, // boolean // 'limit' => null, // integer @@ -26,43 +26,60 @@ // 'category_id' => null, // integer // 'subcategory_id' => null, // integer // 'format_id' => null, // integer + // 'order_by' => null, // string + // 'start_date' => null, // string + // 'end_date' => null, // string + // 'status' => null // string ) ) ); - - if ( $events->have_posts() ) : - while ( $events->have_posts() ) : $events->the_post(); ?> - - - - + +
+ + +
+ +
+ +
+ +
+ have_posts() ) : + while ( $events->have_posts() ) : $events->the_post(); ?> + + + + +
diff --git a/tmpl/compat/twentytwelve/eventbrite-single.php b/tmpl/compat/twentytwelve/eventbrite-single.php old mode 100644 new mode 100755 index 8401e53..973df1d --- a/tmpl/compat/twentytwelve/eventbrite-single.php +++ b/tmpl/compat/twentytwelve/eventbrite-single.php @@ -15,9 +15,10 @@ while ( $event->have_posts() ) : $event->the_post(); ?>
> -
+
- +
+

diff --git a/tmpl/eventbrite-single.php b/tmpl/eventbrite-single.php old mode 100644 new mode 100755 index 6f6e308..6020330 --- a/tmpl/eventbrite-single.php +++ b/tmpl/eventbrite-single.php @@ -15,8 +15,10 @@ while ( $event->have_posts() ) : $event->the_post(); ?>
> -
+
+
+

diff --git a/tmpl/eventbrite-style.css b/tmpl/eventbrite-style.css new file mode 100755 index 0000000..b6764df --- /dev/null +++ b/tmpl/eventbrite-style.css @@ -0,0 +1,41 @@ +/** + * Eventbrite styles for custom theme + * + * @package Eventbrite_API + */ +.eventbrite-event img { + max-width:100%; +} + +.eb-custom-event .eventbrite-join-btn-wrap { + text-align:center; +} + +.eb-custom-event .eventbrite-join-btn { + padding: 11px 30px; + font-weight: normal; + color: #fff; + background-color: #00ab44; + text-transform: uppercase; + text-align: center; + text-decoration: none; + height: auto; + border: 0; + vertical-align: middle; + position: relative; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + transition:All 0.5s ease; + -webkit-transition:All 0.5s ease; + -moz-transition:All 0.5s ease; + -o-transition:All 0.5s ease; + font-size:14px; + font-family: Arial; + min-width:200px; + display:inline-block; +} + +.eb-custom-event .eventbrite-join-btn:hover { + background-color: #00451b; +} \ No newline at end of file diff --git a/uninstall.php b/uninstall.php old mode 100644 new mode 100755