calendar format
See original GitHub issueFeature Request
some calendar improvements for users
- format
- maxDate
- show year
Description
- I think supporting very basic format like ‘yy-mm-dd’ is better. I think you can reference jqueryui’s datepicker (https://jqueryui.com/datepicker/#date-formats). Please look around.
Now I am writing codes like,
// calendar fn
function calendar_format_date(date) {
if ( ! date ) return '';
var year = date.getFullYear();
var month = date.getMonth() + 1;
if ( month < 10 ) month = '0' + month;
var day = date.getDate();
if ( day < 10 ) day = '0' + day;
return [year, month, day].join('-');
}
// from
var today = new Date();
$("#from").calendar({
type: 'date',
endCalendar: $('#to'),
maxDate: new Date(today.getFullYear(), today.getMonth(), today.getDate()),
formatter: {
date: function (date, settings) {
return calendar_format_date(date);
}
}
});
and in api also painfully ,
$('.ui.form').form({}).api({
action: 'blah blah',
method: 'POST',
beforeSend: function(settings) {
settings.data.from = calendar_format_date($('#from').calendar('get date'));
<snip>
In jqueryui, format is
$( ".selector" ).datepicker({
dateFormat: "yy-mm-dd"
});
and get date is
var currentDate = $( ".selector" ).datepicker( "getDate" );
- maxDate is also difficult. See maxDate in jqueryui,
$( ".selector" ).datepicker({
maxDate: "+1m +1w"
});
- I want to change year. think about you want to select +1 year after, you should click 12 times. Just for example, https://demo.mobiscroll.com/javascript/calendar/date-picker#
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Customize & Download Calendar Template - Calendar Labs
Free Calenar Templates - Customize and download 2021 calendar templates in MS Word, Excel, PDF and Image format. Calendar Template can be further...
Read more >Free Calendar Templates - Vertex42
Download free calendars and templates professionally designed by Vertex42, including printable, blank, school, monthly, and yearly calendars.
Read more >Blank monthly calendar - Microsoft templates
This super-flexible blank calendar template can be used for any month of any year. Perfect for posting this month's activities or planning a...
Read more >Calendar Template - WinCalendar
Calendar template in Microsoft Word format. Your choice of Monthly, Weekly and format. Each Calendar template is blank for easy entering of info....
Read more >Create a calendar by using a template - Microsoft Support
Many calendar templates are available for use in Excel and accessible to download. Learn how to use Excel to create a calendar by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Hokwang We will think about adding a very lightweight dateFormat functionality to accomplish this task. Stay tuned 🙂
Not yet done, still on the large todo list