In yii2, how can we display exact current year even if the user has changed the system year.
For eg. if year is 2017 and if we change the year from system to 2018, then how should we display correct year i.e, 2017
If the user cannot choose the year there's simply no point in asking him. If you think that current year is an important piece of info for the user just display a static label generated from server—in PHP that'd be echo date('Y');.
If you feel that having current year changed and not getting it updated real-time in your HTML while the user is filling the survey is not acceptable, you might want to consider making your survey shorter.
Our customer would like our app to have a per-user setting that allows each user to decide the number of days they see in the "week" view of FullCalendar.
Most want to see 10 days (instead of 7). Any suggestions how to accomplish this?
I need to use jquery flot plugin to plot time based data on a graph in a web page. It needs time parameters to be passed in UTC format. Getting current date is quite easy just defining a Date Object help. But i also want the UTC value for last six months from current date how to get that in JS..?
Have a look at link : Jquery Date
I'm using this particular datepicker script (which is not the one provided in jQuery itself, but they happen to have the sane name)
datePicker
And in the examples there's an option to only select dates in the past selectables, however, i can't figure out how to set selectables dates in the past INCLUDING today, without trying to fool the datePicker that the end date is tomorrow (which causes the calendar to render tomorrow selectable, but at select it does nothing)
After lot of testing however i've come into some light about the problem, it seems that when you pass the endDate to the script it transform it to string to later again transform it to a Date object, when doing this the script seems to ignore the hour and it simple puts 00:00:00:00 but when checking the max selectable date it gets 12:00:00:00, since the date i'm givin is greater than today it becomes not selectable.
Thanks in advance
PD: Suggestions like "use another calendar then" means too many changes, so i'd rather try to fix the current one.
I'm having trouble finding an elegant way to allow for date/time input in an html form. I am thinking of having drop down menus for year, month, day, hour, minute, second, millisecond that are populated with valid entries only. I could do this by hard coding values for each drop down menu, but I'm thinking there must be a more elegant way to do this, perhaps with some already existing javascript library that I have not found yet. Any tips for getting this done?
edit: Second, and if possible, millisecond precision is needed for what I'm working on.
edit#2: After reading some of the comments, I have come to the realization that it is probably a bad idea to have drop down menus for the large range of values required by hours/minutes/seconds and especially milliseconds. I think will go with having the DatePicker prototype date chooser, along with a simple textfield for time input.
This can be done quite elegantly with a Jquery plug-in called Datepicker
There are many calendars which can do this, with both date and time :
Calendar Date Select
Control.DatePicker (based on PrototypeJS) my favourite, I made an enhanced version, with more features, I can share it
Dynarch calendar but I find it too heavy
and others
I think a very easy way to do this is by using PHP i.e. for making choosing a day and a month:
Use the select command for the form, then insert a PHP line to initiate a for loop. So for the days the loop would go from 1 -> 31 and for the month from 1 -> 12. So instead of hard coding it for all the days months etc, you can neatly fit it into one line of code with a small bit of PHP added.
You could expand on on this plugin since you want second/millisecond
http://www.jnathanson.com/index.cfm?page=jquery/clockpick/ClockPick