single hour output
-
is there any way to produce a forecast for a single hour?
-
Well I tested
A)
start and end the same: https://cl.ly/3J0g3j381n34[tk_event_weather lat_long=36.7084888,-94.4672261 start_time=2017-10-28T18:00:00-05:00 end_time=2017-10-28T18:00:00-05:00]
and
B)
end time only 1 second later than start time: https://cl.ly/2g0r3X2u2l0d[tk_event_weather lat_long=36.7084888,-94.4672261 start_time=2017-10-28T18:00:00-05:00 end_time=2017-10-28T18:00:01-05:00]
so the answer is “no” as of right now.
Since this shortcode’s purpose is to display weather for an event, I’d imagine it’s pretty typical that displaying extra hours of weather information would typically be acceptable, since events are usually more than just at a moment in time (like a single hour’s display).
However, my initial thought is that I could enable something like this:
end_time=same
[tk_event_weather lat_long=36.7084888,-94.4672261 start_time=2017-10-28T18:00:00-05:00 end_time=same]
If End Time is the “same” on purpose, then display just the start hour’s weather.
Please let me know your thoughts on this.
indeed multiple hours worth of output is what im after ultimately. however im just not sure i need an hour-by-hour forecast as itll chew up a lot of space. the event im currently using ur plugin for starts in the early evening and goes until the last person is too drunk to stand upright (or even sit in a chair for that matter).
so i was thinking about a 6pm, 9pm and 12am report. however, thats three calls to the api if implemented as we’re currently thinking. perhaps an additional shortcode parameter along the lines of “interval” might be better? that way its one api call but the plugin filters the output based on the specified interval parameter.
though in my case it would still be 2 api calls, as im needing output for midnight too. and i would need the “same” method u speak of to achieve my lone midnight forecast. a shame u cant span days in a single call…
Neat real-world scenario. Thanks for sharing.
You could use CSS to hide the ones you don’t want, such as:
.tk-event-weather__wrapper.my-class .template-hourly_horizontal__item:nth-of-type(3n) {
background: red;
}Example: https://cl.ly/3t2C1W3B2A3M
Replace
.my-class
with the class you use in the shortcode or just remove it entirely if you want all shortcodes throughout your site to behave this way.And, of course, replace
background: red;
withdisplay: none;
once you’re sure your nth-of-type is working how you want it… for that, reference https://css-tricks.com/how-nth-child-works/===
Regarding one shortcode / API call per day… that’s the way their API works; it’s not a limitation created by this plugin.
They told me multi-day API calls might be coming soon, but their pricing (each day counting as the usage of 1 API call) was expected to be roughly unchanged… therefore it’s just a wait and see thing right now.
===
Let me know if this answers your question.
Also, can I ask which event calendar you’re using?
had to change the css around to acheive displaying 6, 9 and 12. probably a more elegant way of doing it, by i know just enough to be dangerous.
TAGS:
[tk_event_weather lat_long='36.7084888,-94.4672261' start_time='2017-03-01T18:00:00-06:00' end_time='2017-03-01T21:00:00-06:00' class='tkeventw-widget'] [tk_event_weather lat_long='36.7084888,-94.4672261' start_time='2017-03-02T00:00:00-06:00' end_time='2017-03-02T01:00:00-06:00' class='tkeventw-widget']
CSS:
.tk-event-weather__wrapper.tkeventw-widget { color: #000000; display: inline-block; vertical-align: top; } .tk-event-weather__wrapper.tkeventw-widget .template-hourly_horizontal__item { display: none; } .tk-event-weather__wrapper.tkeventw-widget .template-hourly_horizontal__item:nth-of-type(3n+1) { display: inline-block; }
im using no event calendar for this site as its only purpose is to promote a single event. for my other sites ive used timely’s in the past, but am transitioning to modern tribe’s as ive found a conflict with timely’s and contact form 7 that neither party seems interested in fixing.
Great job!
It’d be better if you add
darksky_credit_link_off='true'
in your 2nd shortcode.The Events Calendar?by Modern Tribe is one of the best. In fact, I do support for them. ??
Disclaimer: my paid add-on for this plugin for their calendar is from me and has nothing to do with them
ahh, yes. i added that after i posted. however, i did so on the first shortcode instead of the second. does it make any difference?
No, it’s up to your personal preference.
I hope it works well for you! ??
- The topic ‘single hour output’ is closed to new replies.