Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Calendar (dateedit) feature request  (Read 10941 times)
David Z.
Posts: 19


« on: July 07, 2010, 05:02:54 pm »

I'm not sure if this a GDC or BDL topic. If the user is in a dateedit field, it would be nice if the user could hit the numeric keypad plus (+) to move forward one day and the minus (-) to go back one day. Also, Ctrl +/- for one month, and Alt +/- for one year.

Thanks,
David
Tim S.
Posts: 26


« Reply #1 on: July 07, 2010, 05:38:12 pm »

I will second that request. :)
I had asked previously about the (+) and (-) for day changes and I like your ideas for month and year movement on top of those.

Tim S
Lionel F.
Four Js
Posts: 82


« Reply #2 on: July 08, 2010, 04:03:09 pm »

Hi,

Indeed the request about (+) and (-) was already asked by Tim and was filed as bz.#16217 (DateEdit hot keys and helpers). I completed the description with propositions made by David. Thank you for the suggestions!

Regards,
Lionel
Reuben B.
Four Js
Posts: 1049


« Reply #3 on: July 09, 2010, 03:06:54 am »

I implemented something similar in my previous job based on functionality I saw in an application (non-4GL) I was exposed to before that.

It was to help keyboard users enter dates.

Basically if you were in a  dateedit field you could a small (1 or 2 characters), press a function key, and have that interpreted into a date.

The expressions were something simple like ...

0 = today
1,2,...,31 = that day of the current month and year
+1 = tomorrow
+2,+3,... = that many days after today
-1 = yesterday
-2,-3,... = that many days before today

... and rarely used complex stuff like ...

+1[wmy] = add that many weeks, months, years to todays date
-1[wmy] = subtract that many weeks, months, years to todays date

<[wmy] = first day of the current week, month, year
>[wmy] = last day of the current week, month, year

and then it hooked into the accounts system so that

<[pqhf] = first day of the current period, quarter, half-year, financial year
>[pqhf] = last day of the current period, quarter, half-year, financial year

as well as other functionality for expressions like 20th following month, as well as only taking working days into consideration

... anyway to implement this in 4GL it was something like

Code
  1. ON ACTION datewizard
  2.   CALL FGL_DIALOG_SETBUFFER(datewizard(FGL_DIALOG_GETBUFFER()))

... and

Code
  1. FUNCTION datewizard(s)
  2. DEFINE s STRING
  3.   CASE
  4.      WHEN s = "0" LET s = TODAY
  5. ...
  6.      OTHERWISE
  7.         -- leave s unchanged if unable to process
  8.   RETURN s
  9. END FUNCTION

... and note that if you are using UNBUFFERED you have to set the validate attribute of the action to "no" e.g.
Code
  1. <ActionDefault name="datewizard"      acceleratorName="F8" defaultView="auto"     validate="no" />
... from memory I added as a global action so I didn't have to explicitly code into every single dialog


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines