[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-10 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

Marcus  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-08 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

oooforum (fr)  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |NOT_AN_ISSUE

--- Comment #25 from oooforum (fr)  ---
As says in comment 1: the format must be 4 digits without dashes.
Conform as F1 help

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-08 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #24 from D Denny  ---
Thanks!
Best regards
David

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-08 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #23 from mroe  ---
> > The simply question is:
> > Which string you get from  
> > columnFinalBudget = RowSet.getString(16)
> > for dates > 2021-09-30?
> > 
> 
> -MM-DD : example 2021-10-05


For
InPutBox( "Date Conversion", "Result:", "CDateFromISO( String ): " &
CDateFromISO( "2021-10-05" ) )
I get the same
“Action not supported. Invalid procedure call.”
No problem with
InPutBox( "Date Conversion", "Result:", "CDateFromISO( String ): " &
CDateFromISO( "20211005" ) )



> dim columnFinalBudget as date ' string
>   columnFinalBudget   
> = RowSet.getDate(16) ' String(16)
> print columnFinalBudget
> 
> resulting in
> 
> "Incorrect Property Value"

You will not get a value with type Date – you get a struct
com.sun.star.util.Date!

http://www.openoffice.org/api/docs/common/ref/com/sun/star/sdb/XColumn.html#getDate
http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/Date.html

Dim newDate As New com.sun.star.util.Date
newDate = RowSet.getDate(16)
print newDate.Year, newDate.Month, newDate.Day

If you want to use the string representation then use
Dim columnFinalBudget As String
Dim dateString As String
columnFinalBudget = RowSet.getString(16)
'Now you can convert it first to a legal ISO representation with the functions
above
'or with string manipulations
'or simply use
dateString = CDate( columnFinalBudget )

For me at this point: EoD. Because it isn't about the issue anymore.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-08 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #22 from D Denny  ---
(In reply to mroe from comment #21)
> (In reply to D Denny from comment #20)
> > I have run separately your sample sub and proven to myself that
> > CDateFromISO() runs perfectly happily on its own.
> 

Firstly, thanks very much for your comprehensive help and careful attention!
Gratefully received.

> The simply question is:
> Which string you get from  
> columnFinalBudget = RowSet.getString(16)
> for dates > 2021-09-30?
> 

-MM-DD : example 2021-10-05


> If the column is defined as DATE you should better read the date rather the
> string representation. So your macro will be independent from any
> uncontrolled string conversion.

please see below **

> 
> AND: Please test your macro with
> Option Explicit
> and define your variables to get sure that there is not an unwanted
> conversion!
> Dim columnFinalBudget As String

Applied

**

changed .getString to getDate as

dim columnFinalBudget as date ' string
columnFinalBudget  
= RowSet.getDate(16) ' String(16)
print columnFinalBudget

resulting in

"Incorrect Property Value"

I think that because the date returned from the SQL VIEW is -MM-DD
it will be necessary to convert it another way, by string removing the "-"
separators. 

Or, I could change the VIEW result definition. Currently specified as DATE. 

So it appears (also re your comment below) that, while SQL is writing dates in
the format -MM-DD, Basic is expecting the format MMDD.

Maybe I should be trying getXXX first. I'll have a look at that.

[... Work In Progress, BRB ...]

> 
> 
> For the original reported bug I suggest to change the help for
> »CDateFromISO«, that it awaits a String in the form of "MMDD". This is
> what the counter part »CDateToISO« supplies.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-08 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #21 from mroe  ---
(In reply to D Denny from comment #20)
> I have run separately your sample sub and proven to myself that
> CDateFromISO() runs perfectly happily on its own.

The simply question is:
Which string you get from  
columnFinalBudget = RowSet.getString(16)
for dates > 2021-09-30?

If the column is defined as DATE you should better read the date rather the
string representation. So your macro will be independent from any uncontrolled
string conversion.

AND: Please test your macro with
Option Explicit
and define your variables to get sure that there is not an unwanted conversion!
Dim columnFinalBudget As String


For the original reported bug I suggest to change the help for »CDateFromISO«,
that it awaits a String in the form of "MMDD". This is what the counter
part »CDateToISO« supplies.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #20 from D Denny  ---
Created attachment 85978
  --> https://bz.apache.org/ooo/attachment.cgi?id=85978=edit
fragment of basic macro showing where cdatefromiso can't be used

I't clear that CDateFromISO() is not usable IN THIS CONTEXT for dates after
30/09/2021.

I have run separately your sample sub and proven to myself that CDateFromISO()
runs perfectly happily on its own.

Therefore I have come to the "intuitive" conclusion that my procedures have
stress tested CDateFromISO() to destruction in certain circumstances.

I have verified that the data items concerned are clean and derive cleanly from
the SQL database (HSQLDB 2.3.4)

There arise two possiblities.
1. that this is a bug in AOO 4.1.1 which has been cleared in later versions.
2. that it needs investigation.

My guess is that this is a memory management issue within AOO/Java: that memory
allocation is breaking the calendar table. If so, this cannot be reproduced by
a simple test macro: it needs stress testing.

I am happy to help as an end user but I fear I cannot go further as I have no
expertise in AOO internals. I am happy to help by alpha testing any suggested
changes.

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #19 from D Denny  ---
I mean, same result, still choking on Oct 2021.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #14 from D Denny  ---
Created attachment 85976
  --> https://bz.apache.org/ooo/attachment.cgi?id=85976=edit
output in full with dates before october 2021

I found originally that my locale was UK English but the document language was
USA English.
In case this mattered I tested first with all set to USA. Then I reset all to
UK.
In both cases CDateFromISO() fails with dates >= 01 October 2021.

So I guess that locale is not an issue.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #18 from D Denny  ---
(In reply to mroe from comment #10)
> (In reply to D Denny from comment #9)
> > insertText(chr(9) + "Scheduled" + chr(9) + columnScheduled + chr(9) +
> > "Ultimate budget payment due" + chr(9) + chr(9) +
> > CDateFromISO(columnFinalBudget))
> > fails with
> > ACTION NOT SUPPORTED INVALID PROCEDURE CALL
> 
> How is columnFinalBudget defined? Where you get it from?
> 
> 
> Nobody have posted a working sample macro or better a document with an
> embedded macro to show the problem, what is expected and what is get.
> And nobody says which LOCALE setting is used!
> 
> Sub Main
> DateTest_mr( "2021-10-11" )
> End Sub
> 
> Sub DateTest_mr( s As String )
> InPutBox( "Date Conversion", "Result:", "String: " & s )
> InPutBox( "Date Conversion", "Result:", "CDate( String ): " & CDate( s ) )
> InPutBox( "Date Conversion", "Result:", "CDateToISO( String ): " &
> CDateToISO( s ) )
> InPutBox( "Date Conversion", "Result:", "CDateToISO( CDate( String ) ): " &
> CDateToISO( CDate( s ) ) )
> InPutBox( "Date Conversion", "Result:", "CDateFromISO( CDateToISO( CDate(
> String ) ) ): " & CDateFromISO( CDateToISO( CDate( s ) ) ) )
> End Sub
> 
> 
> Result: (Locale: English (UK) )
> But remember: This shows only the String representations!
> 
> String: 2021-10-11
> CDate( String ): 11/10/2021
> CDateToISO( String ): 20211011
> CDateToISO( CDate( String ) ): 20211011
> CDateFromISO( CDateToISO( CDate( String ) ) ): 11/10/2021

I tried both UK English and USA English (just in case). Now all set at UK. Same
result. Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #17 from D Denny  ---
(In reply to oooforum (fr) from comment #12)
> Your attached file is an SQL query.
> What is the relationship with this current issue?

I was showing the derivation of the data in answer to the question where does
the data originate... please see other attachments

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #16 from D Denny  ---
My AOO version is 4.1.1
has this been fixed in a subsequent version?

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #15 from D Denny  ---
Created attachment 85977
  --> https://bz.apache.org/ooo/attachment.cgi?id=85977=edit
this is the output if I change the date of the last Budget to 01 October 2021

This shows the text display for the two fields but stops on the first attempt
that CDateFromISO is given 01 Oct 2021.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #13 from D Denny  ---
Created attachment 85975
  --> https://bz.apache.org/ooo/attachment.cgi?id=85975=edit
macro for test purposes

this is a cut down macro showing field derivation

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #12 from oooforum (fr)  ---
Your attached file is an SQL query.
What is the relationship with this current issue?

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

--- Comment #11 from D Denny  ---
Created attachment 85974
  --> https://bz.apache.org/ooo/attachment.cgi?id=85974=edit
in answer to "s columnFinalBudget defined? Where you get it from?"

this is a quick backtrack showing the derivation of the data item in question.

I have elicited that dates beyond October 2021 also fail.

There is a discrepancy in the locale settings in my AOO options. I will update
this shortly. Most settings are default english uk except the default language
for writer docs which is english usa for some reason.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-07 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

mroe  changed:

   What|Removed |Added

 Status|CONFIRMED   |UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #10 from mroe  ---
(In reply to D Denny from comment #9)
> insertText(chr(9) + "Scheduled" + chr(9) + columnScheduled + chr(9) +
> "Ultimate budget payment due" + chr(9) + chr(9) +
> CDateFromISO(columnFinalBudget))
> fails with
> ACTION NOT SUPPORTED INVALID PROCEDURE CALL

How is columnFinalBudget defined? Where you get it from?


Nobody have posted a working sample macro or better a document with an embedded
macro to show the problem, what is expected and what is get.
And nobody says which LOCALE setting is used!

Sub Main
DateTest_mr( "2021-10-11" )
End Sub

Sub DateTest_mr( s As String )
InPutBox( "Date Conversion", "Result:", "String: " & s )
InPutBox( "Date Conversion", "Result:", "CDate( String ): " & CDate( s ) )
InPutBox( "Date Conversion", "Result:", "CDateToISO( String ): " & CDateToISO(
s ) )
InPutBox( "Date Conversion", "Result:", "CDateToISO( CDate( String ) ): " &
CDateToISO( CDate( s ) ) )
InPutBox( "Date Conversion", "Result:", "CDateFromISO( CDateToISO( CDate(
String ) ) ): " & CDateFromISO( CDateToISO( CDate( s ) ) ) )
End Sub


Result: (Locale: English (UK) )
But remember: This shows only the String representations!

String: 2021-10-11
CDate( String ): 11/10/2021
CDateToISO( String ): 20211011
CDateToISO( CDate( String ) ): 20211011
CDateFromISO( CDateToISO( CDate( String ) ) ): 11/10/2021

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2017-03-06 Thread bugzilla
https://bz.apache.org/ooo/show_bug.cgi?id=109652

D Denny  changed:

   What|Removed |Added

 CC||mis...@daviddenny.co.uk

--- Comment #9 from D Denny  ---
insertText(chr(9) + "Scheduled" + chr(9) + columnScheduled + chr(9) + "Ultimate
budget payment due" + chr(9) + chr(9) + CDateFromISO(columnFinalBudget))
fails with
ACTION NOT SUPPORTED INVALID PROCEDURE CALL

This fails for dates in October 2021.
It works for dates before that.
Removing the CDateFromISO() wrapper completes job.

This is a macro which extracts from a View and prints to an .odt writer file.

So, there is a serious untested corner condition or whatever in CDateFromISO.

Yes, I am a bit ahead of the calendar, but not much, considering that the
application is for a loan repayment schedule.

There are plenty other CDateFromISO conversions in the same macro. They all
work, but then are not in the offending month.

I haven't checked whether the error continues AFTER October 2021!

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.

[Issue 109652] CDateFromIso not working for all ISO dates

2014-06-04 Thread bugzilla
https://issues.apache.org/ooo/show_bug.cgi?id=109652

oooforum ooofo...@free.fr changed:

   What|Removed |Added

 CC||ooofo...@free.fr

--- Comment #8 from oooforum ooofo...@free.fr ---
(In reply to charlesli from comment #7)
 CDateFromIso(20021231)  
 results in the error message: #Name?.
 LibreOffice 3.4.4 

Not reproduce with AOO 4.1.0
CDateFromIso(20021231) returns 31/12/2002

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.
You are watching all issue changes.