I'm trying to create a custom date widget. Users can only chose a date from the next 10 days. So, instead of making them chose year, month, day, hours and minutes I want to have a single select list for the date (next 10 days) and two select lists for the time (hours and minutes).
Here is what I'm trying to achieve:
http://i52.tinypic.com/jikrv7.png
This is not just about changing date field settings (like granularity), I'm pretty sure I'll have to write some code to have correct dates in the select list (there could be 5 days from the current month and 5 days from the next one), and then correctly handle everything after user submits data.
What's the best way to achieve this? Where should I start from?
I would greatly appreciate any suggestions.
Thank you!
You need to implement hook_widget and possibly hook_widget_info and hook_widget_settings. Also have a look at CCK for developers.
Related
I am having trouble finding a solution. I am using ACF5.
I would like a field to automatically change its value 7 days after the post author has chosen a value.
I am using a select field (Featured) with 2 values (Featured, Not Featured).
If you have a solution with a different type a field that would work too.
I found this https://wordpress.stackexchange.com/a/85606/124674 However, I do not know how to to use it.
Your help is greatly appreciated.
In order to do so you need two things:
a) you need to know when user modified that field.
Therefore you have to add some modified date field where you put a timestamp of last change of the featured field. Additionally if you have a lot of posts you may have a user_modified field "flag" to mark specific entries as needing attention.
b) you need to have a cron task which runs every minute / hour
This task would scan the wp_postmeta table in certain time intervals. When it finds the field which was modified by user and the modification date is older than XX days then you switch the value to the desired one.
I know that this is an overall overview and you still have a lot of small tiny details to figure out but those depend on your scenario.
I am trying to implement a form in ionic and I am struggling with the date inputs. I set the upper range of the interval of dates allowed to be 2100 (comparing to the end of the current year,which is by default),but I want the following scenario to happen: when someone clicks to choose a date, I want the picker to start from the current date and to allow going up and down to choose a past of future date. At the moment,the picker starts at the upper end of the interval,2100, and it is difficult for someone to go down to 2016 or so,if they need dates close to the current day.
<ion-datetime max="2100-12-31" [(ngModel)]="formItem.input"></ion-datetime>
How can I achieve this? Thank you!
I want to create a dashboard that shows me how many clicks I had today vs how many clicks I had on the exact same day last week.
From the docs, the diffSeries function can subtract a series from another but how do I get the timeseries of previous week?
It's look like you need timeShift function.
As the title suggest, I would like to get the previous month using the given month from Get System Info. I used Get System Info step to get todays month and year, and from there I would like to get the previous month. This is so it would be dynamic and I can ran this any day and still get the correct filter rather than making a hard coded year and month. Is this possible? If so, how do I do that?
Here is how I did it. This is the overview
Here is the calculator:
And concatenate fields:
There is still a few loop hole on getting the previous month during January. But, that is how I did it.
I have a calendar for day view, month view and week view. In month view all the days in the particular month (month which user selects) will be displayed in a grid. Suppose if a month begins by wednesday/thursday then the cells of monday, tuesday remains blank. Instead I need to display last two days of previous month and similarly if the month ends on monday/tuesday then the remaining cells should be filled with starting dates of succeeding month. pls provide code for this functionality..... thanx in advance... :-)
Why don't you try using a premade control like the ASP .Net calendar control or jquery UI's DatePicker?
http://jqueryui.com/demos/datepicker/
I am not sure what your requirements are. Maybe there is a control out there that can work for you?
If you want to do this yourself, how are you programming it? Can you explain a little more of how you are creating this control?