Google calendar wrong date issue from URL - php

SO here is the problem ... I had created calendar on http://lanyrd.com with same dates but for some reason, my code is showing dates "from" and "to" on the same date, and other (from Lanyrd site) is showing dates correctly and I can't figure it out why ... Can someone help me?
Lanyrd site generated URL code:
https://www.google.com/calendar/render?action=TEMPLATE&text=Test+Naziv&dates=20120815/20120817&location=Osijek&details=Ajme+meni+ovo+je+test+naziv&pli=1&sf=true&output=xml
Mine code:
https://www.google.com/calendar/render?action=TEMPLATE&text=eZ+Publish+Basic+Concepts&dates=20121008/20121009&location=TBD,+USA&details=This+training+is+required+for+all+other+trainings+and+provides+a+perfect+entry+into+the+way+of+thinking+when+you+intend+working+with+eZ+Publish+as+a+developer,+editor+or+administrator.&pli=1&sf=true&output=xml

Well, checking the URL's, I would say Google Agenda takes the 'to'-date minus one. As you can see in Lanyrd's URL: dates=20120815/20120817
It's two days apart, but in Google Agenda it shows as 2012-08-16. Your dates are only one apart, so will enter the same date. Plus-one your to-date, and you're problem is solved.

Related

Outlook Calendar link to create a new event URL is no longer working?

In our web application we providing the below link to create a calendar event when I click on the button it will open the outlook mail portal and add an event link
https://outlook.live.com/owa/?path=/calendar/view/month&rru=addevent
&startdt=20200419T133000Z
&enddt=20200419T134000Z
&subject=Dear Andy, Calender description here&location=Mumbai
But unfortunately, the above link is no longer working, could anybody help us to fix the issue and tell what is the exact link format that will create a calendar event.
Seems to be working now. At least the add event pop-up does appear. Still the time is parsed in a wrong way. At the moment you should be using following format: 2020-04-19T13:30:00Z
Still texts are also parsed incorrectly and show plus signs. Pointing to outlook.live.com/calendar/0/deeplink/compose instead of outlook.live.com/owa/ is fixing this but will break the timezone :)
Never found any docs on this.

FullCalendar Week view contains too many events

I used fullcalendar as a "participation calendar" to know how many people goes to an event everyday.
Problem is, if I got more than 3 people going at the same hour to my event, the view becomes too full to see anything in week mode.
I thought about 2 ideas to solve this problem:
When there's more than 3 people going to the event show "more", but
this doesn't seem to work in AgendaWeek mode.
Invert days and hours, to profit of more space.
Here's a screenshot showing my problem:
If you have any solutions or any idea that could help me I'll be glad to know them :)
I'm using Fullcalendar V3.
Thanks

Display text on webpage from list depending on date

I'm not professional developer, but I help to manage the IT for a group of churches in the UK. I thought this might be the place to ask for help.
They have a website, which runs wordpress. They also have a monthly prayer diary. There is a list, and each day, members pray for something or someone specific.
I was wondering if there was a way of displaying the day's prayer using PHP/HTML, on the site, from a list of prayers that is located on the server. For example, on 1st July, it might be 'We pray for the local schools', so somewhere on the site, on the 1st July would be the text 'Today we pray for the local schools'. This would automatically change to something like 'we pray for our local firefighters' on the 2nd of July, depending on what is on the list.
This would preferably be done by easily uploading a csv file(?) to wordpress/the web server, and the site would automatically find and display the prayer associated with today's date (server-side time) from the file???
I'm running wordpress on Windows IIS, with PHP of course.
I would be really grateful if someone could help.
Thanks
You could use a 'quote of the day' plugin. There are a number of them available, you just need to find one that allows you to upload the content.
Here's a search to start you off: https://www.google.com/search?client=firefox-b-d&q=wordpress+plugin+quote+of+the+day
The Flexi Quote Rotator on this page looks promising: https://hostingreviewbox.com/10-awesome-free-quote-of-the-day-wordpress-plugins/

How to make a weekly calendar with events

I'm trying to make a calendar like this Fullcalendar but all the calendars that I can find online are showing the whole month. I already made a calendar but i don't know how to put the events under the right day. The calendar needs to be a full week because I want to have multiple calendar underneath each other for multiple people.
I solved my problem with the code on this site https://www.phpzag.com/create-event-calendar-with-jquery-php-and-mysql/#

How to make featured image change automatically based on current time

I'm customising a wordpress site with a static front page. I'm using a responsive/dynamic theme.
What I want to do is make it so that the featured image that is loaded on the front page will be different based on a time. For example: Say someone goes to my website at 6pm, I would want the featured image on the front page to show a picture of the night sky. However, if someone visits my site before 6pm (and as early as say 5am), then the featured image should show a picture of the day sky.
Iv'e looked everywhere for a plugin to do this for me but one does not seem to exist. Iv'e also googled this endlessly and could not find specific solutions but I have been able to find sources to get me started.
Adding featured image from external source via php and sql:
http://www.wpexplorer.com/wordpress-featured-image-url/
(it would be easier to just use and UPDATE statement and change the image url in the database)
Getting time in given timezone:
Get current date, given a timezone in PHP?
I could have used a lot of the code from the links provided to achieve what I want but I ran into a PROBLEM. I CANNOT find the image url of the featured image in the wordpress database. I've looked in both _postmeta and _posts with no luck. Instead it just shows the image urls of the images that came with the theme originally but have since been changed. This could possibly have something to do with the fact that I've been using the Jetpack plugin (photon) to load my images from wordpress.com servers but I have turned the feature off and still can't find the image url in the database.
As I am not a pro in php and sql it would be great to be pointed in the right direction or even better if someone could come up with a solution. I know it's not an easy implementation but definitely worthwhile as solutions cannot be found elsewhere.
This can easily be done with javascript..
Here is a quick example I did:
https://jsfiddle.net/p2snuf1a/
var date = new Date();
var hours = date.getHours();
var sunset_img= "http://at-cdn-s01.audiotool.com/2014/06/03/documents/85NwUJbwC0Gx0rbiKePSWWcKUqhmdP/0/cover256x256-46428e19514b49058125b21b8107c2eb.jpg";
var night_img = "https://pbs.twimg.com/profile_images/2973095145/47f74748e0c6240db5e0b3034af6da16.jpeg";
if(hours > 18){
document.getElementById('feature_img').setAttribute('src', night_img);
}
else{
document.getElementById('feature_img').setAttribute('src', sunset_img);
}
Basically, it gets the current hour, sets some variables to the image links (these can be locally stored images too). Then it checks if the hours is greater or less than a certain time, so 18 is 6pm.
You can add more 'else if()' options for other time/image combinations.
If you have your images located in your css, you can use the '.sytle' instead of .setAttribute
Well this is a preety simple task, but i can see one issue with it. PHP will be using it's own server's time to calculate day and night. So if your server is in New york and some one is surfing your website from INDIA, it will show the image depending on the time in NEW YORK. So to achieve the user's local time you will either have to use javascript or use a geo locating api that will show the exact time of the given location. Here is an example.
http://api.geonames.org/timezone?lat=47.01&lng=10.2&username=demo
For now lets just suppose you want to change the image depending on the server time. So as you only have 2 images for day and night, hardcoding it should not be an issue. (If you want to have custom fields, can look into "Advanced custom fields" plugin, it is a brilliant plugin to add custom fields in your posts).
I haven't tested this code, but it should work.
date_default_timezone_set('America/Chicago');
$am_pm = date('a');
if($am_pm == 'am'){?>
<img src="<?php echo get_template_directory();?>/images/am.png" alt="Good Morning">
<?php }elseif($am_pm == 'pm'){?>
<img src="<?php echo get_template_directory();?>/images/pm.png" alt="Good Evening">
<?php }?>

Categories