We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Diplay month name on first of each month (mobile)

Thread ID:

Created:

Updated:

Platform:

Replies:

148302 Oct 14,2019 04:06 PM UTC Oct 16,2019 06:38 AM UTC React - EJ 2 3
loading
Tags: Schedule
Ronan Ca
Asked On October 14, 2019 04:09 PM UTC

Hello,

I'd like to be able to display the month name on the first day of each month on mobile, the same as it appears on computer.
I am using react and javascript es6.
Take a look to my attached screenshot.

Kind regards

Ronan

Attachment: request_month_name_e62ef3b3.zip

Karthigeyan Krishnamurthi [Syncfusion]
Replied On October 15, 2019 06:23 AM UTC

 
Syncfusion greetings. 
 
We have achieved your requirement using dataBound and actionComplete events. 
 
onBound() { 
    if (Browser.isDevice && this.flag && this.scheduleObj.currentView === "Month") { 
      this.custom(); 
    } 
  } 
  onComplete(args) { 
    if (Browser.isDevice && (args.requestType === "dateNavigate" || args.requestType === "viewNavigate") && this.scheduleObj.currentView === "Month") { 
      this.custom(); 
    } 
  } 
  custom() { 
    var collection = document.querySelectorAll('.e-date-header'); 
    var count = collection.length; 
    for (var i = 0; i < count; i++) { 
      if (collection[i].innerText === "1") { 
        var date = collection[i].offsetParent.getAttribute('data-date'); 
        var intl = new Internationalization(); 
        var dFormatter = intl.getDateFormat({ skeleton: 'MMMd', type: 'date' }); 
        var formattedString = dFormatter(new Date(parseInt(date))); 
        collection[i].innerHTML = formattedString; 
        this.flag = false; 
      } 
    } 
  } 
 
Regards, 
Karthi 
 


Ronan Ca
Replied On October 15, 2019 09:22 AM UTC

Hello,

Thank you Karthi,your answer and example are perfect.

Best regards

Ronan

Vinitha Devi Murugan [Syncfusion]
Replied On October 16, 2019 06:38 AM UTC

Hi Ronan, 
 
Thanks for your update. 
 
We are happy that our solution fulfilled your requirement 😊. 
 
Regards, 
M.Vinitha devi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon