Libraryless. Click here for Pure Java version (2785L/18K).
1 | static Long ai_englishToDate(S s) { |
2 | ret ai_englishToDate(s, now()); |
3 | } |
4 | |
5 | static Long ai_englishToDate(S s, long now) { |
6 | if "today|now" ret now; |
7 | if "yesterday" ret now()-daysToMS(1); |
8 | if "the day before yesterday" ret now()-daysToMS(2); |
9 | if "tomorrow" ret now()+daysToMS(1); |
10 | if "the day after tomorrow" ret now()+daysToMS(2); |
11 | null; |
12 | } |
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: | 344 / 421 |
Version history: | 3 change(s) |
Referenced in: | [show references] |