question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request

some calendar improvements for users

  1. format
  2. maxDate
  3. show year

Description

  1. 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" );
  1. maxDate is also difficult. See maxDate in jqueryui,
$( ".selector" ).datepicker({
  maxDate: "+1m +1w"
});
  1. 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:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
lubber-decommented, Mar 19, 2019

@Hokwang We will think about adding a very lightweight dateFormat functionality to accomplish this task. Stay tuned 🙂

2reactions
lubber-decommented, Jul 12, 2020

@lubber-de Any news about dateFormat? 😃

Not yet done, still on the large todo list

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found