Render the calendar with week numbers in Angular Calendar component

27 Apr 20241 minute to read

You can enable the weekNumber in Calendar by using the weekNumber
property.

import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { CalendarModule } from '@syncfusion/ej2-angular-calendars'




import { Component } from '@angular/core';

@Component({
imports: [
        
        CalendarModule //declaration of ej2-angular-calendars module into NgModule
    ],


standalone: true,
    selector: 'app-root',
    template: `
        <!-- Sets the weekNumber -->
        <ejs-calendar [value]='dateValue' weekNumber='true'></ejs-calendar>
        `
})

export class AppComponent {
    public dateValue: Date = new Date();
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));