Skip to content
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

Wrong template when language and first day changing #25

Open
afterlife88 opened this issue Jan 17, 2017 · 0 comments
Open

Wrong template when language and first day changing #25

afterlife88 opened this issue Jan 17, 2017 · 0 comments

Comments

@afterlife88
Copy link

afterlife88 commented Jan 17, 2017

When initialize calendar setup is Danish language and first day is Monday (1 in config)
Then I want to change to English with first day 0. Year view is displaying wrong template (dates not starting from Sunday and still having same display as was at initialize step).

At initialize calendar:
image
View after changing on month view after recreation of calendar (Display as expected):
image
Year view is wrong:
image

Code that using:

<!DOCTYPE html>
<html>
<head>
	<meta charset='utf-8' />
	<link href='../dist/fullcalendar.css' rel='stylesheet' />
	<link href='../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
	<script src='../lib/moment/moment.js'></script>
	<script src='../lib/jquery/dist/jquery.js'></script>
	<script src='../dist/fullcalendar.js'></script>
	<script src='../dist/lang/da.js'></script>
	<script>
		$(document).ready(function() {

			calendarrender()

			$("#btn").click(function(){				
				$('#calendar').fullCalendar( 'destroy' );
				$('#calendar').fullCalendar({
					header: {
						left: 'prev,next today',
						center: 'title',
						right: 'year,month,agendaWeek,agendaDay'
					},
					lang: 'en',					
					firstDay: 0,
				});				   
			});
			function calendarrender(){
				$('#calendar').fullCalendar({
					header: {
						left: 'prev,next today',
						center: 'title',
						right: 'year,month,agendaWeek,agendaDay'
					},
				// defaultDate: '2015-01-12',
				defaultView: 'year',
				selectable: true,
				selectHelper: true,				
				lang: 'da',
				firstDay: 1,
				editable: true			
			})}});
		</script>
		<style>

			body {
				margin: 40px 10px;
				padding: 0;
				font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
				font-size: 14px;
			}

			#calendar {
				max-width: 900px;
				margin: 0 auto;
			}

		</style>
	</head>
	<body>
		<button type="submit" id="btn">click</button>
		<div id='calendar'></div>

	</body>
	</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant