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. Image for the cookie policy date

Diplay month name on first of each month (mobile)

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

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team 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 
 



RC Ronan Ca October 15, 2019 09:22 AM UTC

Hello,

Thank you Karthi,your answer and example are perfect.

Best regards

Ronan


VD Vinitha Devi Murugan Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon