How can I change a Laravel Nova metric's ending date? - php

By default, all Laravel Nova Metrics end at the current time. For instance, if I wanted to end it a day before so that the metric shows yesterday's results without showing today's, this doesn't appear to be possible. As of now, it will show both days. How can I accomplish showing only yesterday?

I was able to accomplish this by extending the trend class and just manually changing the end date to the last completed month rather than current date.

Related

How to create a repeating Events like google gmail in php?

I want to create repeating Events like gmail. IF any idea, Please let me know? Thanks in advance.
You can setup/install the Date module on your site. Then, in the Event content type, configure your event date field with the repeat option enabled (see screenshot in Lullabot's blog post about the date module)
Also, here are a few considerations about dates during your Event content type and views setup process:
Once you configure the date field and add event content with those fields defined, you won't be able to modify the field settings to a more restrictive state. (For example, if you enable repeat and then decide to disable repeat). A work around for this is to create a new date field with desired settings, use views bulk operations to copy the data from obsolete date field to new date field, then delete obsolete date field.)
When working with repeating or ongoing events, you'll need to determine how you want them to appear in chronological event listing views. (For example, ongoing events may wind up showing at top of list if your sort is based only on start date. If your view is limited to very few listings/results, and all your events repeat- make sure there's enough variety of events to avoid showing the same repeating event back to back in the view. You may want to consider showing only distinct results in the view.)
When working with repeating dates, do the times also repeat? If not, you may want to also install the Node Clone module and configure so content managers can copy event nodes and edit/modify times.
If showing times, do you need to show timezones associated with them?

Drupal Calendar - How to change week layout?

I need to change the calendar week view, to be more user friendly.
Please check this screenshot, I am explaining the goal to reach on it:
https://www.diigo.com/item/image/4otf9/eb3r
https://www.diigo.com/item/image/4otf9/1qcb
The website has some dates for events, that are mainly during night. So, there are some events starting at 2AM for exemple. It doesn't make sense displaying these events in next day. For exemple, if the party starts on saturday night at 2AM, then it could me confusing for the user to display it on Sunday.. How can I adapt the week templates to start the day at 5AM (instead 00:00) and finish at 24:00 (instead 24:00)
And about multi-day dates, how to display them next to the single day dates??
Change the Settings of the Calendar format in the Views and set the time grouping to custom. In the box, specify the intervals/start times that you want to show up starting at the hour you want to start at. See illustration below:
You can change the Week display like this too.

Input Start Date and End Date to MYSQL Database

I am trying to create a webpage where users can input the start & end date and time for the DIV to appear. After it reaches the end date, the DIV will be deactivated until the users have input another start and end date and time. I have start date and end date column in my MYSQL database. How do I start ? Any hints? Or maybe better suggestions on how this works.
These are the requirements:
- Must allow the questionnaire to be released for a fixed time period
- Should allow the questionnaire to be issued more than once.
Have a look at http://www.php.net/manual/en/function.mysqli-connect.php
This will give you an idea. When you have your code you can come back to this site and ask concrete questions.
setInterval(function(){
$("#YOUR_DIV_ID").hide();
}, 60000);
You can use setInterval using JQuery to hide your DIV I have given 1 minute interval, Else you can remove your div using:
$("#YOUR_DIV_ID").remove();
This is the one of easy way.

multi datepicker to get dates from input field?

so my problem is this. I use the multi datepicker, http://multidatespickr.sourceforge.net/
for a site with news block. i save multiple dates for 1 news item and it works like a charm with php. BUT now my problem is, if someone wants to edit the news , I do get the current dates the news has, in a input field, but that isn't marked on the multi datepicker. problem here is, if they selected 30 dates, and want to exclude one after editing, they have to pick 29 dates again on datepicker, cause they wouldn't be active otherwise. my question here is, is there any way to make the datepicker get the dates from an input field ? FYI I get the same date formats both on getting and selecting from datepicker.
You'll have to show the context in which you use it, but the addDates parameter looks like it does what you want, so on instantiation you would pick up the list of dates from your input field and supply them in this parameter. See also how to pre-select dates.
I'm surprised the datepicker isn't permanently alive and just shows itself, in which case it would know what state it was in from last time it was hidden.
Update: reading even further it seems it uses the dates from an input field anyway. See this demo further in the instructions

jquery date and time picker

i am using jquery date and time picker in one my project where users can create an event. in the jquery datepicker, i have the option to select the today's date and future date and not the past date which is good for an event creattion website. but i am stuck with the time picker. for example, if i am in the event creation page(assume now time is 9.30am) and select date as 2010-08-05, then i click on the time field but the time field shows time that is already past i.e. time before 9.30, i cannot allow user to choose time that is before the current time. how can i valdiate this? or is there any way not to show the past time?
I am using php, if i decide to validate using php, how i am supposed to validate, which time I should use as base to check the user selected time? users can come from any country so how i am supposed to know which is past time for an user.
I use this http://labs.perifer.se/timedatepicker/, I use the first option and I can use the last option where users allowed to enter two fields which is good as we can know the duration and good thing is second field works based on the i/p in the first field but still this doesnt solve my past time issue.
please let me know if i am not clear.
regards
>> users can come from any country so how i am supposed to know which is past time for an user.
If I understand you well, the best way is to check at the client side(in javascript).
Here is the sample code .
$("#time").timePicker({
startTime:new Date() // pass the current time
});​
Then, the timePicker will omit the past and start from the current time.

Categories