Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Function CalcWeekDate 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Akari Oct-26-2024 (created) 
 | 
    value := ""; 
 | 
    if( this.TimeUnit() = "Week" ){ 
 | 
      date := this.CustomDate().StartOfNextWeek() - 1 ; 
 | 
      stringDate := date.Format( "Y/M2/D2"); 
 | 
      perSuffx := ifexpr( this.CustomDate().Week() < 10,"0"+[String]this.CustomDate().Week(),[String]this.CustomDate().Week() ); 
 | 
      value := "KW" + perSuffx + " - " + stringDate; 
 | 
    }else if( this.TimeUnit() = "Month" ){ 
 | 
      us_locale := Locale::Construct( 'en_us' ); 
 | 
       
 | 
      date := this.CustomDate(); 
 | 
      stringDate := date.Format( "Y: MM / M" + "月" ,us_locale ) 
 | 
      value := stringDate; 
 | 
    }else{ 
 | 
      value := this.CustomDate().Format( "Y/M2/D2" ); 
 | 
    } 
 | 
     
 | 
    this.DisplayDate( value ); 
 | 
  *] 
 | 
} 
 |