91place
WatchMaker Bug Tracking All the ideas and discussions
7 votes Vote

Calendar not evaluating properly

string.format('%s %- .30s%s', '{c1b}' , string.sub('{c1t}', 1, 28), string.len('{c1t}') > 30 and '.. ' or string.sub('{c1t}', 29, 30))
Has been working for a while. Now with the new calendar features if I have both Show All Day Events and Show Events After Today switched on, it fails to evaluate and shows the formula. At the same time, the exact same string with {c2t} and {c2b} evaluates fine. If I just type {c1b} in the box it evaluates to 18:00 and {c1t} evaluates to SUN: Grandma Franklin's Birthday.Just in case I had some weird typo, I pasted the #2 string and edited the 2's to 1's and again it failed to evaluate.

yourdaguy, 22.01.2015, 21:14
Idea status: rejected

Comments

Narsil, 20.02.2015, 13:54
Almost same problem but it's not "Show all day" and "Show event after ..." dependent, the following code is not evaluated and displayed as is :

{c1bp} >= {dtp} and '{c1b}' or '{c2b}'

It did work one or two days, and suddenly stopped working.

Tried with simple and double quotes without success.
mfiori, 04.04.2015, 18:09
Similar issue. Seems to be the case that if

'{c1bp}'== ''

evaluates as true then any formula attempting to use {c1bp} fails

example


'{c1bp}'== '' and 45 or
(1-({c1bp}-{dtp}))
AlexCurran, 10.06.2015, 10:09
you need to deal with cases where {c1bp} is an empty string, i.e. no event
therefore '{c1bp}'== '' and 45 or (1-({c1bp}-{dtp})) will break because of the {c1bp} at the end
AlexCurran, 10.06.2015, 10:27
WatchMaker 3.8 (soon in beta) fixes this by :
blank calendar events {c1br}, {c1bp}, {c1be}, {c1ep} - they now return -1

so you would use something like
{c1ex} and (1-({c1bp}-{dtp})) or 45

always use {c1ex} to check existence of events, not '{c1bp}'== ''

Leave a comment