Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1020700 // ai_englishToDate [old]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2785L/18K).

static Long ai_englishToDate(S s) {
  ret ai_englishToDate(s, now());
}

static Long ai_englishToDate(S s, long now) {
  if "today|now" ret now;
  if "yesterday" ret now()-daysToMS(1);
  if "the day before yesterday" ret now()-daysToMS(2);
  if "tomorrow" ret now()+daysToMS(1);
  if "the day after tomorrow" ret now()+daysToMS(2);
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1020700
Snippet name: ai_englishToDate [old]
Eternal ID of this version: #1020700/4
Text MD5: a9411e3d134abcfcee581052863df46a
Transpilation MD5: 12980e6fd85355f9da351a8754e76aea
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-25 17:37:06
Source code size: 352 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 419
Version history: 3 change(s)
Referenced in: [show references]