Show Today's date by default in Joomla default Datepicker using JHTML::Calendar
Tag : joomla , By : ponchopilate
Date : March 29 2020, 07:55 AM
hop of those help? I want to Show Today's date by default in Joomla default Datepicker using JHTML::Calendar(), I am calling this in the Mosets Tree extension: , Try this, <td>
<?php
echo JHTML::calendar(date("Y-m-d"),'revdate', 'date', '%Y-%m-%d',array('size'=>'8','maxlength'=>'10','class'=>' validate[\'required\']',));
?>
</td>
|
How do I change a DatePickerDialog's default date from today's date to a user selected date?
Date : March 29 2020, 07:55 AM
Any of those help When the user picks the date, use the following to communicate the data back to your Activity once the dialog closes (communicating data from a fragment back to the starting activity): http://developer.android.com/training/basics/fragments/communicating.htmlOnce you receive the values back in your activity, use the following when starting your DatePickerFragment: DatePickerFragment datepickerfragment = new DatePickFragment();
Bundle bundle = new Bundle();
bundle.putInt("YEAR", currentyear);
bundle.putInt("MONTH", currentmonth);
bundle.putInt("DAY", currentday);
datepickerfragment.Arguments = bundle;
fragmentmanager.BeginTransaction().Add(R.layout.container, datepickerfragment).Commit();
int year = this.Arguments.getInt("YEAR");
int month = this.Arguments.getInt("MONTH");
int day = this.Arguments.getInt("DAY");
....
int year = this.Arguments.getInt("YEAR");
int month = this.Arguments.getInt("MONTH");
int day = this.Arguments.getInt("DAY");
if(year != null){
return new DatePickerDialog(getActivity(), this, year, month, day);
}else{
final Calendar c = Calendar.getInstance();
year = c.get(Calendar.YEAR);
month = c.get(Calendar.MONTH);
day = c.get(Calendar.DAY_OF_MONTH);
return new DatePickerDialog(getActivity(), this, year, month, day);
}
|
How to restore the default value(i.e. today's date or current date) of input box having date when clicked on reset butto
Date : March 29 2020, 07:55 AM
I wish this helpful for you Use $( ".datepicker" ).datepicker('setDate','today'); inside onClick event listener. $( function() {
$( ".datepicker" ).datepicker();
$( ".datepicker" ).datepicker('setDate','today');
} );
$("#resetBtn").on('click',function(){
$( ".datepicker" ).datepicker('setDate','today');
})
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<label>Order Date: </label>
<div class="input-group date" data-provide="datepicker">
<input type="text" class="datepicker" />
</div>
<button type="reset" id="resetBtn">Reset</button>
|
Flutter - DatePicker is not opening if it is same date(today)
Date : March 29 2020, 07:55 AM
I wish this help you Here is the solution You need to make defineSelectable function return true on initialDate you are passing. See the working code below DateTime selectedDate = DateTime.now();
DateTime initialData;
bool defineSelectable(DateTime val) {
DateTime now = DateTime.now();
//make it return true on initialDate
if(val.compareTo(initialData)==0){
return true;
}
// disabled all days before today
if (val.isBefore(now)) {
return false;
}
// disabled all days except Friday
switch (val.weekday) {
case DateTime.friday:
return true;
break;
default:
return false;
}
}
int daysToAdd(int todayIndex, int targetIndex) {
print('todayIndex $todayIndex');
print('targetIndex $targetIndex');
if (todayIndex < targetIndex) { // jump to target day in same
week
return targetIndex - todayIndex;
} else if (todayIndex > targetIndex) { // must jump to next
week
return 7 + targetIndex - todayIndex;
} else {
return 0; // date is matched
}
}
DateTime defineInitialDate() {
DateTime now = DateTime.now();
int dayOffset = daysToAdd(now.weekday, DateTime.friday);
print('dayOffset: $dayOffset');
return now.add(Duration(days: dayOffset));
}
Future<Null> _selectDate(BuildContext context) async {
initialData = defineInitialDate();
print('defineInitialDate: ${initialData}');
print('defineSelectable: $defineSelectable');
final DateTime picked = await showDatePicker(
context: context,
initialDate: initialData,
selectableDayPredicate: defineSelectable,
firstDate: DateTime(2018, 12),
lastDate: DateTime(2020, 12));
if (picked != null && picked != selectedDate) selectedDate =
picked;
//var formatter = DateFormat('EEEE, dd-MMMM-yyyy');
//String formatted = formatter.format(selectedDate);
print('Select Date: $selectedDate');
//_askGiveProvider.meetingSink(formatted);
//addEventBloc.eventDateSink(formatted);
}
|
selecting an a default date today date in atextbox using ajax calendar control
Date : March 29 2020, 07:55 AM
|