How to restrict a dates of datepicker Fuelux? - datepicker

How to restrict a dates of datepicker Fuelux???
I have a datepicker with several properties .
I need to restrict the first 20 days of January .
Is it ( 01-01-2015 Up 20-01-2015 ).
$('#myDatepicker1').datepicker('setCulture', 'es');
$('#myDatepicker1').datepicker('setFormat', 'DD-MM-YYYY');
$('#myDatepicker1').datepicker('setDate', '01-22-2015');
I found the next code, but Dont worked.
$('#myDatepicker1').datepicker(
'setDate', '01-22-2015
restricted: [{from: '01-01-2013', to: '01-01-2014'}]');
In advance thanks for the help you can give me.

setDate is not an initialization option. It is a method that can only be run once the control has been initialized.
Try something like this:
$('#myDatepicker1').datepicker({
momentConfig: {
culture: 'es',
format: 'DD-MM-YYYY'
},
restricted: [{from: '01-01-2013', to: '01-01-2014'}]
});
$('#myDatepicker1').datepicker('setDate', '01-22-2015');
Be sure that you have the MomentJS library loaded before Fuel UX.

Excellent answer. Thank Interactive Llama. It worked and works perfect. He presented a problem because when you set the start date inside the range of blackout dates , the datepicker not understand this configuration and sets the current day.
The correct configuration is initialized by placing the date outside the range of time blackout dates .
I also tried loading the moment.js before and after fuelux file, and in both cases the datepicker worked. Anyway I preferred to leave it as you indicated. (Load moment.js file before the Fuelux library).
Here is the final code for its observation.
$('#myDatepicker1').datepicker({
allowPastDates: true,
momentConfig: {
culture: 'es',
format: 'DD-MM-YYYY'
},
restricted: [
{from: '01-01-1900', to: '31-12-2014'}
]
});
$('#myDatepicker1').datepicker('setDate', '01-01-2015');
Thanks for your help Interactive Llama.

Related

Rundeck time format

In the "Activity for jobs' page in Rundeck the execution time has a relative time field (example: "Today at 10:15 AM" or "Last Sunday at 4:51 AM") after the timestamp.
It is easy to change the date format of the timestamp by adding jobslist...format[.ko] in the i18n/messages.properties file.
It seems impossible however to change the format of the relative time message. It seems to be hard-coded in en_US with AM/PM which doesn't look too good in in non-English-speaking countries. The format is always the same regardless of the ?lang=xx parameter or the default language in the browser. Interestingly, other objects (like hovering over the field with the mouse and the duration get translated).
Has anyone successfully changed this?
Example. See the duration field
I have been trying this with the docker images (4.8.0, 4.9.0 and SNAPSHOT)
I've looked at the source code and apparently this lies somewhere in the moment.js code.
In some parts, the date formats are hard coded as you say, please add your use case on this thread.

how to make a day from date in LibreOffice?

I want to convert date into a Day
I am using LibreOffice
I used some of its syntax weekday and text but it returns nothing
WEEKDAY("30-04-2019"; 1) is there any way to do that?
in google sheet i used =TEXT(C7758,"dddd") but it didn't work
how can I do that?
thanks in advance
Try the combination of functions WEEKDAY and DATE:
=WEEKDAY(DATE(2019;4;30))
The specific example will return 3 which is Tuesday (see all days and other options at https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_WEEKDAY_function)
Hope that helps.

SMF.UI.showDatePicker Showing Wrong Date

I'm not getting the selected date, but the emulator's system date. Tried publishing and installing on actual Samsung S6, same it's showing system date not selected date. Is there something wrong with my code below?
function Page1_TextButton1_OnPressed(e)
{
SMF.UI.showDatePicker({onSelect:DoSomething});
}
function DoSomething(e)
{
alert(e.date);
}
Your code has some missing but that is not the actual problem. You are probably trying to select a date from past. There is a problem about that and will be fixed with the next release.
By the way I suggest you to use datePicker as in the documents (http://docs.smartface.io/html/M_SMF_UI_showDatePicker.htm).
You should add mask, minDate and maxDate values, etc.
But as I said, although you add these values to your project, it will not work now. The problem will be fixed with the next release.

fuelux : start datepicker on monday

I try to load the datepicker of fuelux with start of the week to Monday.
i have already try this:
$('#myDatepicker').datepicker({
culture: 'fr',
format: 'L' });
but without success...
It should be, per datapicker options:
$('#myDatepicker').datepicker({
momentConfig: {
culture: 'fr',
format: 'L'
}
});
However, this will only set the format of the input box--not the calendar. I'm not sure if there is a way to have the calendar start on Monday (you can change the day names at the top to French, of course). The team was not aware that the "French week" started on Lundi. Please post an issue.

Grails Date variable will not set the time

I make a simple domain class
class Meetings {
Date when
String where
}
Then I run 'generate-all' on Meetings. I then start the app 'RunApp'.
In the app I'm able to to choose the month, day, and year for the when variable, however I can't choose the time as in hours:minutes (example 7:30). I wouldn't expect to be able to do this, but if I save the date it formats it as month, day, year, and then -00:00:00. How do I set the time using the date variable? or is there another way?
If you are using the datepicker tag in grails, it is pretty straight forward.
In the views folder under a domain class folder there is _form.gsp. Inside _form.gsp is a date picker tag.
<g:datePicker name="dateTimeVariableName" value="${dateTimeValue}"
default="${new Date().clearTime()}" precision="minute"/>
The keyword here is precision.
You should check the documentation. Its always a good idea. Hope this helps.