Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function timeomission(texttime: text) :: timespan:
- if {_texttime} does not contain "hour" or "hours" or "minute" or "minutes" or "seconds" or "second" or "tick" or "ticks" or "day" or "days":
- if {_texttime} contains "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "0":
- if {_texttime} contains "d" or "h" or "t" or "m" or "s":
- loop 9 times:
- replace all "d%loop-number%" with "d %loop-number%" in {_texttime}
- loop 9 times:
- replace all "h%loop-number%" with "h %loop-number%" in {_texttime}
- loop 9 times:
- replace all "t%loop-number%" with "t %loop-number%" in {_texttime}
- loop 9 times:
- replace all "m%loop-number%" with "m %loop-number%" in {_texttime}
- loop 9 times:
- replace all "s%loop-number%" with "s %loop-number%" in {_texttime}
- if {_texttime} starts with " ":
- set {_texttime} to subtext of {_texttime} from characters 2 to (length of {_texttime})
- replace all "d" with " day" in {_texttime}
- replace all "h" with " hour" in {_texttime}
- replace all "t" with " tick" in {_texttime}
- replace all "m" with " minute" in {_texttime}
- replace all "s" with " second" in {_texttime}
- set {_texttime} to {_texttime} parsed as timespan
- return {_texttime}
- stop
- return 0 tick
- stop
- set {_texttime} to {_texttime} parsed as timespan
- return {_texttime}
- function listtotext(list: objects) :: string:
- loop {_list::*}:
- if {_text} is not set:
- set {_text} to "%loop-value%"
- else:
- set {_text} to "%{_text}%, %loop-value%"
- return {_text}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement