Skip to content

7.x 2.x dev#11

Closed
gblackid5 wants to merge 30 commits intoidfive:7.x-2.x-devfrom
gblackid5:7.x-2.x-dev
Closed

7.x 2.x dev#11
gblackid5 wants to merge 30 commits intoidfive:7.x-2.x-devfrom
gblackid5:7.x-2.x-dev

Conversation

@gblackid5
Copy link

Repeating Events and Mini Calendar

  • Fixed processDate in Events.php. Was trying to access protected object. Using drupal_get_query_parameters(); instead.
  • Commented out filterString += '&fields=id,clndrDate,date'; . Was breaking the array of dates returned.
  • Event Details showing first date when event clicked. Will be fixed using start_unix in url.
  • Unsured $query variable in Events.php will be removed in next request

return $http.get(utilityService.getBaseUrl() + 'events' + filterString).then(function(response) {
// console.log('clndr',response);
// if module to split repeated events into separate nodes is turned on
if(service.replicate == false){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to !service.replicate, which would account for false, undefined, NaN, ''.

// if more dates in the array add them as objects at the end of the response.data.data
// this get the repeating dates out of nodes
for(var x in response.data.data){
// console.log(response.data.data[x].date.length);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this is a super old version.

if(response.data.data[x].date.length > 1){
for(var y in response.data.data[x].date){
var d = new Date(response.data.data[x].date[y].start_unix * 1000);
// console.log(d);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging.

// if clndrEvent is null add one
if( !response.data.data[x].clndrDate ){
var d = new Date(response.data.data[x].date[0].start_unix * 1000);
// console.log(d);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging.

return $http.get(utilityService.getBaseUrl() + 'events' + filterString).then(function(response) {
var r;
var unix = dateService.dateNowUnix();
console.log(response.data);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging.

return $http.get(utilityService.getBaseUrl() + 'events' + filterString).then(function(response) {
return $http.get(utilityService.getBaseUrl() + 'events' + filterString).then(function(response) {
// if module to split repeated events into separate nodes is turned on
if(service.replicate == false){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to if (!service.replicate)

filterString = filterString + '&page=' + service.page;

/** DEBUG **/ window.console.log(filterString);
/** DEBUG window.console.log(filterString);**/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

start = unix;
}

if( filterString.includes('filter[date][value][1]=') ){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change .includes to .indexOf

}

// if there is an end date and started and hasn't ended
if( (filterString.includes('filter[date][value][1]=') && n.start_unix > start && n.end_unix < end) ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change .includes to .indexOf

}else{
service.reserve.push(obj[x][y]);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace

Copy link
Author

@gblackid5 gblackid5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the updates

@gblackid5 gblackid5 closed this Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants