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.

Cannot set Calendar startdate

See original GitHub issue

I have tried setting the calendar startday both in XAML and also in code behind.

I have even tried placing it in 3 different areas:

in XAML that didn’t work:

<controls:Calendar StartDate="{Binding Date}" EnableTitleMonthYearView="true" x:Name="calendar" Padding="10,0,10,0" StartDay="Monday" SelectedBorderWidth="4" DisabledBorderColor="Black">
            </controls:Calendar>

So I tried adding it from c# code:

 calendar = new XamForms.Controls.Calendar
            {

                BorderColor = Color.Gray,
                BorderWidth = 3,
                BackgroundColor = Color.White,
                StartDay = DayOfWeek.Monday,
                StartDate = DateTime.Now.AddDays(1)
            };

and even using the method and field:

 calendar.StartDate = Date;
            calendar.CalendarStartDate(Date);

None of them worked 😦

Am I missing something? I even tried redrawing it forcefully but still, it didn’t start the calendar from my designated date. I read I might need to add something to my AssemblyInfo.cs:

[assembly:Xamarin.Forms.Platform.<Platform>.ExportRenderer(typeof(XamForms.Controls.CalendarButton),typeof(XamForms.Controls.<Platform>.CalendarButtonRenderer))]

But, when I type this bit: [assembly:Xamarin.Forms.Platform.

it does not even include iOS and Droid let alone ExportRenderer

What am I doing wrong here?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Muthutccommented, Jul 16, 2018

thnx ali-h2010 itz working fine,

calendar.StartDate=DateTime.Today;

0reactions
ali-h2010commented, Apr 17, 2018

@amirvenus please update us on this issue and close it if done

Read more comments on GitHub >

github_iconTop Results From Across the Web

End date occurs before start date
Whenever I click "OK" on the Outlook Options window, I get the message "The end date you entered occurs before the start date....
Read more >
unable to set calendar start date in pikaday calendar
When i trigger the start date input box, I want to show the future or past month in calendar popup as a starting...
Read more >
How I can fix error "No start date has been set"?
The problem is that you wrap setting the properties of the EKEvent in a dispatch async block, while you save the even outside...
Read more >
Unable to make changes to an existing Calendar entry
I have this Calendar entry with a reminder. Regretfully I can't change anything to it, like setting Reminder: 0 hours.
Read more >
Altering due date in Microsoft To-Do > Change event start ...
I have set up the predefined zap “Create Microsoft To-Do tasks for new or updated Google Calendar events”. This is great because it...
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