Class: Google::Apis::DocsV1::DateElementProperties

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/docs_v1/classes.rb,
lib/google/apis/docs_v1/representations.rb,
lib/google/apis/docs_v1/representations.rb

Overview

Properties of a DateElement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DateElementProperties

Returns a new instance of DateElementProperties.



859
860
861
# File 'lib/google/apis/docs_v1/classes.rb', line 859

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#date_formatString

Determines how the date part of the DateElement will be displayed in the document. If unset, the default value is DATE_FORMAT_MONTH_DAY_YEAR_ABBREVIATED, indicating the DateElement will be formatted as MMM d, y in en, or locale specific equivalent. Corresponds to the JSON property dateFormat

Returns:

  • (String)


813
814
815
# File 'lib/google/apis/docs_v1/classes.rb', line 813

def date_format
  @date_format
end

#display_textString

Output only. Indicates how the DateElement is displayed in the document. Corresponds to the JSON property displayText

Returns:

  • (String)


818
819
820
# File 'lib/google/apis/docs_v1/classes.rb', line 818

def display_text
  @display_text
end

#localeString

The language code of the DateElement. For example, en. If unset, the default locale is en. Limited to the following locales: af, am, ar, as, az, be, bg, bn, ca, cs, da, de, el, en, en-CA, en-GB, es, es-419, et, eu, fa, fi, fil, fr, fr-CA, gl, gu, hi, hr, hu, hy, id, is, it, iw, ja, ka, kk, km, kn, ko, lo, lt, lv, mk, ml, mn, mr, ms, ne, nl, no, or, pa, pl, pt-BR, pt-PT, ro, ru, si, sk, sl, sq, sr, sv, sw, ta, te, th, tr, uk, ur, uz, vi, zh-CN, zh-HK, zh-TW, zu, cy, my. Corresponds to the JSON property locale

Returns:

  • (String)


831
832
833
# File 'lib/google/apis/docs_v1/classes.rb', line 831

def locale
  @locale
end

#time_formatString

Determines how the time part of the DateElement will be displayed in the document. If unset, the default value is TIME_FORMAT_DISABLED, indicating no time should be shown. Corresponds to the JSON property timeFormat

Returns:

  • (String)


838
839
840
# File 'lib/google/apis/docs_v1/classes.rb', line 838

def time_format
  @time_format
end

#time_zone_idString

The time zone of the DateElement, as defined by the Unicode Common Locale Data Repository (CLDR) project. For example, America/New_York. If unset, the default time zone is etc/UTC. Corresponds to the JSON property timeZoneId

Returns:

  • (String)


845
846
847
# File 'lib/google/apis/docs_v1/classes.rb', line 845

def time_zone_id
  @time_zone_id
end

#timestampString

The point in time to represent, in seconds and nanoseconds since Unix epoch: January 1, 1970 at midnight UTC. Timestamp is expected to be in UTC. If time_zone_id is set, the timestamp is adjusted according to the time zone. For example, a timestamp of 18000 with a date format of DATE_FORMAT_ISO8601 and time format of TIME_FORMAT_HOUR_MINUTE would be displayed as 1970-01-01 5:00 AM. A timestamp of 18000 with date format of DATE_FORMAT_ISO8601, time format of TIME_FORMAT_HOUR_MINUTE, and time zone set to America/ New_York will instead be 1970-01-01 12:00 AM. Corresponds to the JSON property timestamp

Returns:

  • (String)


857
858
859
# File 'lib/google/apis/docs_v1/classes.rb', line 857

def timestamp
  @timestamp
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



864
865
866
867
868
869
870
871
# File 'lib/google/apis/docs_v1/classes.rb', line 864

def update!(**args)
  @date_format = args[:date_format] if args.key?(:date_format)
  @display_text = args[:display_text] if args.key?(:display_text)
  @locale = args[:locale] if args.key?(:locale)
  @time_format = args[:time_format] if args.key?(:time_format)
  @time_zone_id = args[:time_zone_id] if args.key?(:time_zone_id)
  @timestamp = args[:timestamp] if args.key?(:timestamp)
end