eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'AbstractChronologyObject':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: AbstractChronologyObject


Inheritance:

   Object
   |
   +--Magnitude
      |
      +--AbstractChronologyObject
         |
         +--AbstractTime
         |
         +--Date

Package:
stx:libbasic
Category:
Kernel-Chronology
Version:
rev: 1.9 date: 2024/04/18 14:22:42
user: cg
file: AbstractChronologyObject.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


This is an abstract class defining common methods for dates and time-like objects

copyright

COPYRIGHT (c) 2023 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

change & update
o  update: something with: aParameter from: changedObject
just remember change for next access

general queries
o  abbreviatedDayNamesForLanguage: languageOrNilForDefault
return a collection of short month-names for a given language or the
current language if nil is given.
The returned strings depend on the resource translation file to be present for the
given language (i.e. libbasic/resources(<lang>.rs).
If not, english names are returned

Usage example(s):

     self abbreviatedDayNamesForLanguage:#en   
     self abbreviatedDayNamesForLanguage:#de   
     self abbreviatedDayNamesForLanguage:#fr   
     self abbreviatedDayNamesForLanguage:#es   
     self abbreviatedDayNamesForLanguage:#zulu 

     self abbreviatedDayNamesForLanguage:nil   

o  abbreviatedMonthNamesForLanguage: languageOrNilForDefault
return a collection of short month-names for a given language or the
current language if nil is given.
The returned strings depend on the resource translation file to be present for the
given language (i.e. libbasic/resources(<lang>.rs).
If not, english names are returned

Usage example(s):

     self abbreviatedMonthNamesForLanguage:#en
     self abbreviatedMonthNamesForLanguage:#de
     self abbreviatedMonthNamesForLanguage:#fr
     self abbreviatedMonthNamesForLanguage:#es
     self abbreviatedMonthNamesForLanguage:#zulu

     self abbreviatedMonthNamesForLanguage:nil

o  abbreviatedNameOfDay: dayIndex
given a day index (1..7),
return the abbreviated name of the day
for the current language setting

Usage example(s):

     Date abbreviatedNameOfDay:4

o  abbreviatedNameOfDay: dayIndex language: langOrNilForDefault
given a day index (1..7),
return the abbreviated name of the day.
For nil, the current default language us used.
For unknown languages, english is used.

Usage example(s):

     Date abbreviatedNameOfDay:4 language:#en    
     Date abbreviatedNameOfDay:4 language:#de    
     Date abbreviatedNameOfDay:4 language:#zulu  
     Date abbreviatedNameOfDay:4 language:nil    

o  abbreviatedNameOfMonth: monthIndex
given a month index (1..12),
return the abbreviated name of the month
for the current language setting

Usage example(s):

     Date abbreviatedNameOfMonth:11
     Date abbreviatedNameOfMonth:12

o  abbreviatedNameOfMonth: monthIndex language: langOrNilForDefault
given a month index (1..12),
return the abbreviated name of the month.
For nil, the current default language us used.
For unknown languages, english is used.

Usage example(s):

     Date abbreviatedNameOfMonth:11 language:#en     
     Date abbreviatedNameOfMonth:12 language:#en     
     Date abbreviatedNameOfMonth:12 language:#de     
     Date abbreviatedNameOfMonth:12 language:#fr     
     Date abbreviatedNameOfMonth:12 language:#zulu   
     Date abbreviatedNameOfMonth:12 language:nil     

o  dayNamesForLanguage: languageOrNilForDefault
return a collection of day-names for a given language or the
current language if nil is given.
The returned strings depend on the resource translation file to be present for the
given language (i.e. libbasic/resources(<lang>.rs).
If not, english names are returned

Usage example(s):

     self dayNamesForLanguage:#en
     self dayNamesForLanguage:#de
     self dayNamesForLanguage:#fr   
     self dayNamesForLanguage:#es   

     self dayNamesForLanguage:#zulu 
     self dayNamesForLanguage:nil   

o  monthNamesForLanguage: languageOrNilForDefault
return a collection of month-names for a given language or the
current language if nil is given.
The returned strings depend on the resource translation file to be present for the
given language (i.e. libbasic/resources(<lang>.rs).
If not, english names are returned

Usage example(s):

     self monthNamesForLanguage:#en  
     self monthNamesForLanguage:#de  
     self monthNamesForLanguage:#de_at  
     self monthNamesForLanguage:#fr   
     self monthNamesForLanguage:#es   

     self monthNamesForLanguage:#zulu 
     self monthNamesForLanguage:nil   

o  nameOfDay: dayIndex
given a day index (1..7), return the name of the day

Usage example(s):

     Date nameOfDay:1
     Date nameOfDay:4

o  nameOfDay: dayIndex language: lang
given a day index (1..7), return the name of the day.
For nil, Smalltalk language is used,
for unknown languages, english is used.

Usage example(s):

     Date nameOfDay:4 language:#en

o  nameOfMonth: monthIndex
given a month index (1..12), return the name of the month

Usage example(s):

     Date nameOfMonth:11
     Date nameOfMonth:12
     Date nameOfMonth:4

o  nameOfMonth: monthIndex language: lang
given a month index (1..12), return the name of the month.
For nil, Smalltalk language is used,
for unknown languages, english is used.

Usage example(s):

     Date nameOfMonth:11 language:#en
     Date nameOfMonth:12 language:#en
     Date nameOfMonth:4  language:#en
     Date nameOfMonth:1  language:#de     => 'Januar'
     Date nameOfMonth:1  language:#de_de  => 'Januar'
     Date nameOfMonth:1  language:#de_at  => 'Jänner'

initialization
o  initDefaultNames
read the language specific names.

Usage example(s):

     Date initDefaultNames

o  initNames
read the language specific names.

Usage example(s):

     Date initNames

o  initNamesForLanguage: language
read the language specific names.

Usage example(s):

     Date initNamesForLanguage:#de.
     Date initNamesForLanguage:#de_at.
     Date initNamesForLanguage:#de_de.
     Date initNamesForLanguage:#de_auto.
     Date initNamesForLanguage:#en.
     Date initNamesForLanguage:#en_en.
     Date initNamesForLanguage:#en_au.
     Date initNamesForLanguage:#fr.
     Date initNamesForLanguage:#es.

o  initialize
Modified (comment): / 07-06-2023 / 10:43:03 / alkurz

o  resourcesForLanguage: language
guard for tinytalk (no libview)

instance creation
o  dateAndTimeNow
return an array filled with the current date and time.
As these provide no timezone info, this should be only used for user interface purposes.
See also: Date today / Time now / Timestamp now.

Usage example(s):

     Time dateAndTimeNow       
     Date dateAndTimeNow       

misc ui support
o  iconInBrowserSymbol
( an extension from the stx:libtool package )
the browser will use this as index into the toolbariconlibrary

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

Compatibility-ANSI
o  monthAbbreviation
return the month of the receiver as a string.
The returned string depends on the language setting.
Expect things like 'jan', 'feb' ...

Usage example(s):

     Date today monthAbbreviation  

Compatibility-Squeak
o  asDateAndTime
( an extension from the stx:libcompat package )
return an Timestamp instance, representing midnight of last night

Usage example(s):

     Date today asDateAndTime

private
o  additionalPicoseconds
return the additional picoseconds within the current second (0..999999999).
Here, assume that we have none



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:56:00 GMT