Skip to content

Commit

Permalink
update example.lang
Browse files Browse the repository at this point in the history
  • Loading branch information
marques-work committed Oct 4, 2017
1 parent 026d05c commit 2d53379
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/example.lang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "users.lang"

let SHORT_DATE_FORMAT = "%Y-%m-%d"
let ONE_DAY = 1000 * 60 * 60 * 24 # 1 day in milliseconds

entity Profile {
firstName: $dict("first_names"),
Expand Down Expand Up @@ -33,10 +34,10 @@ entity CartItem {
quantity: $int(1, 3),
tax: stateTax + federalTax,
totalTax: quantity * tax,
saleDate: $date,
bestByDate: (lambda addTimeDelta() { saleDate + (86400 * 10) })(), # 86400 is one day in seconds,
# which are the required units for
# date addition/subtraction
saleDate: $date(),

# can perform date/time arithmetic; precision is in milliseconds
bestByDate: (lambda addTimeDelta() { saleDate + ONE_DAY })(),
}

entity Cart {
Expand Down

0 comments on commit 2d53379

Please sign in to comment.