/// <summary> /// Returns a version of this formatter customized to the provided time zone. /// </summary> /// public virtual DateFormatter WithTimeZone(IBM.ICU.Util.TimeZone timeZone_0) { if (!timeZone_0.Equals(this.timeZone)) { return(new YMDDateFormatter(requestedFields, localeName, timeZone_0)); } return(this); }
/// <summary> /// Set the name of the locale that will be used when creating new /// formatters. /// </summary> /// /// <param name="localeName">the name of the Locale</param> /// <returns>this BasicDurationFormatterFactory</returns> public virtual DurationFormatterFactory SetTimeZone(IBM.ICU.Util.TimeZone timeZone_0) { if (!timeZone_0.Equals(this.timeZone)) { this.timeZone = timeZone_0; Reset(); } return(this); }
protected internal BasicDurationFormatter(PeriodFormatter formatter_0, PeriodBuilder builder_1, DateFormatter fallback_2, long fallbackLimit_3, String localeName_4, IBM.ICU.Util.TimeZone timeZone_5) { this.formatter = formatter_0; this.builder = builder_1; this.fallback = fallback_2; this.fallbackLimit = fallbackLimit_3; this.localeName = localeName_4; this.timeZone = timeZone_5; }
public virtual DurationFormatter WithTimeZone(IBM.ICU.Util.TimeZone timeZone_0) { if (!timeZone_0.Equals(this.timeZone)) { PeriodBuilder newBuilder = builder.WithTimeZone(timeZone_0); DateFormatter newFallback = (fallback == null) ? null : fallback .WithTimeZone(timeZone_0); return(new BasicDurationFormatter(formatter, newBuilder, newFallback, fallbackLimit, localeName, timeZone_0)); } return(this); }
/// <summary> /// Creates a new formatter that formats the requested fields using the /// provided locale and time zone. /// </summary> /// /// <param name="requestedFields_0">the requested fields</param> /// <param name="localeName_1">the locale to use</param> /// <param name="timeZone_2">the time zone to use</param> public YMDDateFormatter(String requestedFields_0, String localeName_1, IBM.ICU.Util.TimeZone timeZone_2) { this.requestedFields = requestedFields_0; this.localeName = localeName_1; this.timeZone = timeZone_2; Locale locale = IBM.ICU.Impl.Duration.Impl.Utils.LocaleFromString(localeName_1); this.df = new SimpleDateFormat("yyyy/mm/dd", locale); this.df.SetTimeZone(timeZone_2); }
/// <summary> /// Sets the TimeZone of the Calendar used by this DateFormat. /// </summary> /// /// <param name="timezone">the TimeZone</param> public void SetTimeZone(IBM.ICU.Util.TimeZone timezone) { calendar.SetTimeZone(timezone); }
private BasicDurationFormatter f; // cache /// <summary> /// Create a default formatter for the current locale and time zone. /// </summary> /// internal BasicDurationFormatterFactory(BasicPeriodFormatterService ps_0) { this.ps = ps_0; this.localeName = System.Globalization.CultureInfo.InvariantCulture.ToString(); this.timeZone = IBM.ICU.Util.TimeZone.GetDefault(); }
public virtual PeriodBuilder WithTimeZone(IBM.ICU.Util.TimeZone timeZone) { // ignore the time zone return(this); }