-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Date #72
Comments
Only not console.log(date2); but inititaldate: date2 |
Can you create a jsbin or jsfiddle with this first? |
When I add value in html as in this link it works, but i need to add it dynamically. I did it by JavaScript (find element and set value) and when I check it in browser console (elements) I see that this input has a correct value but it's not beeing displayed. So i tried the property initialdate as it's discriped in here: https://github.com/mdehoog/Semantic-UI-Calendar but it didn't work at all. |
Please try |
It helped, thx ! |
I have the same issue, I'm trying to set the value of an input text inside a modal. The calendar picker is working (it displays good) but the default date is not being set, the textbox is empty.
Here is the modal
|
I've got code below in $(document).ready function and it works. |
thanks, got it working now. It also accepts momentjs format
|
Another solution to this is the momentjs |
Thanks jaimesangcap, momentjs is clearer solution. |
the calendar works fine with moment date object. Just format your date something like Also make sure input value also has initial value. |
As the calendar has been merged into https://github.com/fomantic/Fomantic-UI , here are the docs |
I have no idea how to automaticly fullfill the input with some day. I am using fullcalendar and when clicked I am taking a date from it's event. I tried in fiew differrent formats put in initialvaue property bu it didnt work.
This is my code when clicked on the calendar:
dayClick: function (date, jsEvent, view) {
$('#wizyta').show();
$('#rangestart').calendar({
type: 'datetime',
monthFirst: false,
endCalendar: $('#rangeend'),
firstDayOfWeek: 1,
ampm: false,
text: {
days: ['Nd', 'Pon', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'],
months: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'],
monthsShort: ['Sty', 'Lu', 'Mar', 'Kwie', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrze', 'Paź', 'Lis', 'Gru'],
today: 'Dziś',
now: 'Teraz'
},
formatter: {
date: function (date, settings) {
if (!date) return '';
var day = date.getDate();
var month = ("0" + (date.getMonth() + 1)).slice(-2);
var year = date.getFullYear();
return year + '-' + month + '-' + day;
}
}
});
var date2 = moment(date).format('YYYY-MM-DD HH:mm');
console.log(date2)
}
The text was updated successfully, but these errors were encountered: