Bug Hunting Session
Bug 62301 - RFE: macro writing; improve interop between calc cells and datefield control forms
Summary: RFE: macro writing; improve interop between calc cells and datefield control ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-UNOAPI
  Show dependency treegraph
 
Reported: 2013-03-13 16:17 UTC by Douwe Gelling
Modified: 2019-09-19 12:56 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Douwe Gelling 2013-03-13 16:17:01 UTC
In calc, setting a date on a cell from a python macro is very difficult.
The cell expects a CDate, a numerical value from some specific offset, but this offset is not known to the user. 

Furthermore, the value returned by calling getDate() on a DateField is returned as a numerical value in a different format, e.g. 20130313 for 13/03/2013. Converting between these different values is not simple.

A workaround for example is to use setFunction instead, using a date string that's manually created by the user, and the function =DATEVALUE. However, this is error prone.

Perhaps cell objects could have a setDate value, that could accept a date in different formats, including the ISO 8601 format used by DateFields?
Comment 1 Joel Madero 2013-03-18 16:44:49 UTC
Thank you for reporting this enhancement request! I can confirm that this is a valid enhancement request on:
Version 4.1.0.0.alpha0+ (Build ID: b514f0ce86e85d9be269ddf2e797befbbf3423f)
Date:   Thu Mar 7 21:46:30 2013 +0200 
Platform: Bodhi Linux 2.2 x64
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
As I've been able to confirm the enhancement request I am marking as:

New (confirmed)
Enhancement
Lowest (won't affect many users at all, only would impact our power users)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 2 Lionel Elie Mamane 2013-10-30 05:50:44 UTC
DateFields now return their value as a UNO com.sun.star.util.Date struct.

As to the offset used by Calc, I don't know how to get it, but there should
be a way to get it indeed.