http://www.newton-inc.com/dev/techinfo/qa/qa.htm
StringToDateFrame
and StringToTime
don't seem to work. StringToDateFrame
returns a frame with NIL for all the time & day slots, and StringToTime
returns NIL.StringToDateFrame
and StringToTime
:
PrepareStringForDateTime := func (str)
begin // str is just a time string, nothing else belongs
local newStr := clone (str);
local tf:= GetLocale().timeFormat;
local startMin := StrPos (str, tf.timeSepStr1, 0);
local startSec := StrPos (str, tf.timeSepStr2, startMin+1);
// If a time seperator for seconds, then strip out seconds
if startSec then
begin
local skipSecSep := startSec + StrLen (tf.timeSepStr2);
local remainderStr := SubStr (
str, skipSecSep, StrLen (str) - skipSecSep);
local appendStr := StringFilter (
remainderStr, "1234567890", 'rejectBeginning);
newStr := SubStr (str, 0, startSec) & appendStr;
end;
return newStr;
end;
GetDateStringSpec
formats the supplied date elements in reverse order. Is this is a bug?GetDateStringSpec
uses the elements in reverse order, although some functions that use dateStringSpecs may not observe the order defined by the dateStringSpec. For instance, some functions may use the elements of the dateStringSpec, but use the element ordering defined by the locale bundle. GetDateStringSpec([[kElementYear, kFormatNumeric],[kElementMonth,
kFormatNumeric],[kElementDay, kFormatNumeric] ]);