FieldCreateDateUseLunarCalendar 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 CREATEDATE fields to display document creation dates.
// Open an existing document and move a document builder to the end
Document doc = new Document(MyDir + "Document.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToDocumentEnd();
builder.Writeln(" Date this document was created:");

// Insert a CREATEDATE field and display, using the Lunar Calendar, the date the document was created
builder.Write("According to the Lunar Calendar - ");
FieldCreateDate fieldCreateDate = (FieldCreateDate)builder.InsertField(FieldType.FieldCreateDate, true);
fieldCreateDate.UseLunarCalendar = true;
Assert.AreEqual(" CREATEDATE  \\h", fieldCreateDate.GetFieldCode());
builder.Writeln();

// Display the date using the Umm al-Qura Calendar
builder.Write("According to the Umm al-Qura Calendar - ");
fieldCreateDate = (FieldCreateDate)builder.InsertField(FieldType.FieldCreateDate, true);
fieldCreateDate.UseUmAlQuraCalendar = true;
Assert.AreEqual(" CREATEDATE  \\u", fieldCreateDate.GetFieldCode());
builder.Writeln();

// Display the date using the Indian National Calendar
builder.Write("According to the Indian National Calendar - ");
fieldCreateDate = (FieldCreateDate)builder.InsertField(FieldType.FieldCreateDate, true);
fieldCreateDate.UseSakaEraCalendar = true;
Assert.AreEqual(" CREATEDATE  \\s", fieldCreateDate.GetFieldCode());
builder.Writeln();

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