AmpersandTarski / prototype

Prototype framework that transforms your Ampersand model into a web application
MIT License
1 stars 2 forks source link

Formatting date and time #65

Open stefjoosten opened 2 years ago

stefjoosten commented 2 years ago

Situation

The following code gives us the current date:


CONTEXT Issue1228  IN ENGLISH

   RELATION sessionToday[SESSION*Date] -- or whatever the DateTime concept is called
   REPRESENT Date TYPE DATE
   ROLE ExecEngine MAINTAINS "Initialize today's date"
   RULE "Initialize today's date": I[SESSION] |- sessionToday;sessionToday~
   VIOLATION (TXT "{EX} SetToday;sessionToday;SESSION;", SRC I, TXT ";Date")

INTERFACE Overview : "_SESSION" cRud
BOX [ date : sessionToday cRuD ]

ENDCONTEXT

It produces the following output afbeelding

Requirement

As an Ampersand user, I want to modify the date-time format, something a bit similar to what I can do in Excel.

Analysis

This is related to issue AmpersandTarski/Ampersand#1089.

Version of Ampersand that was used

Ampersand-v4.3.0 [32141f41cf2af837d59eb57bc73320f4ef48fa00:refs/heads/development]

Steps to reproduce

  1. In your browser, navigate to https://rap.cs.ou.nl
  2. Login and create a new script.
  3. Copy the code above and compile it.
  4. Generate a prototype
  5. Run your prototype
  6. Initialize the database
Michiel-s commented 2 years ago

For us to implement this elegantly, we first require AmpersandTarski/Ampersand#1089