FieldDateUseLunarCalendar Property

Gets or sets whether to use the Hijri Lunar or Hebrew Lunar calendar.

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool UseLunarCalendar { get; set; }

Property Value

Type: Boolean
Examples
Shows how to insert DATE fields with different kinds of calendars.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// One way of putting dates into our documents is inserting DATE fields with document builder
FieldDate fieldDate = (FieldDate)builder.InsertField(FieldType.FieldDate, true);

// Set the field's date to the current date of the Islamic Lunar Calendar
fieldDate.UseLunarCalendar = true;
Assert.AreEqual(" DATE  \\h", fieldDate.GetFieldCode());
builder.Writeln();

// Insert a date field with the current date of the Umm al-Qura calendar
fieldDate = (FieldDate)builder.InsertField(FieldType.FieldDate, true);
fieldDate.UseUmAlQuraCalendar = true;
Assert.AreEqual(" DATE  \\u", fieldDate.GetFieldCode());
builder.Writeln();

// Insert a date field with the current date of the Indian national calendar
fieldDate = (FieldDate)builder.InsertField(FieldType.FieldDate, true);
fieldDate.UseSakaEraCalendar = true;
Assert.AreEqual(" DATE  \\s", fieldDate.GetFieldCode());
builder.Writeln();

// Insert a date field with the current date of the calendar used in the (Insert > Date and Time) dialog box
fieldDate = (FieldDate)builder.InsertField(FieldType.FieldDate, true);
fieldDate.UseLastFormat = true;
Assert.AreEqual(" DATE  \\l", fieldDate.GetFieldCode());
builder.Writeln();

doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.DATE.docx");
See Also