<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - DATEADD() LOBasic function displays year incorrectly"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=114011">114011</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DATEADD() LOBasic function displays year incorrectly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0.0.0.alpha1+ Master
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Mac OS X (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>BASIC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>iplaw67@tuta.io
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
It was reported on the German M-L that the help is incorrect when describing
how to enter the string for the date. Indeed, it does seem wrong, or rather
incomplete, but that is tangential to what is to follow:

1) Open a Writer document
2) Create a new macro module in the document with the following :


Sub example_dateadd
MsgBox DateAdd("m", 1, 31012004) &" - "& DateAdd("M", 1, 31012005)
End Sub

Try and execute the macro.


Using the above:

- if use double quote characters around the date string, I get various error
messages, such as "unsuported type", or "unsupported operation" depending on
which way I type the string separators (dots or slashes);

- if I use as in the above example, i.e. no quotes around what is essentially
an integer, I get a MsgBox that displays "31/01/32767 - 31/01/32767" which is
obviously incorrect.


This latter behaviour is the one being reported here.


Steps to Reproduce:
See above description

Actual Results:  
See above

Expected Results:
Correct display of the year.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:57.0)
Gecko/20100101 Firefox/57.0</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>