starscript icon indicating copy to clipboard operation
starscript copied to clipboard

More formatting options

Open Xenapte opened this issue 1 year ago • 5 comments

This commit adds format and formatDateTime to Starscript. Yes, I know one of the selling points of Starscript is to be faster than String.format, but sometimes you do need more formatting options.

format(fmt, ...args)

Adds arbitrary formatting by calling String.format. This can be considered as a fix to [#7] too.

formatDateTime(fmt)

Calls SimpleDateFormat because currently Starscript date and time don't allow the user to choose a custom format.

Xenapte avatar Apr 23 '24 06:04 Xenapte

Hi, would you like to add a timezone variable to formatDateTime(fmt)?

RealMuffinTime avatar May 22 '24 10:05 RealMuffinTime

Hi, would you like to add a timezone variable to formatDateTime(fmt)?

Java SimpleDateFormat already supports displaying of the timezone. Do you mean adding the option to switch to another timezone?

Xenapte avatar May 25 '24 16:05 Xenapte

Yeah, I mean the option to switch the timezone.

RealMuffinTime avatar May 25 '24 19:05 RealMuffinTime

Yeah, I mean the option to switch the timezone.

I added that as an optional argument to formatDateTime. Don't know if this PR is getting merged though.

Xenapte avatar Jun 28 '24 01:06 Xenapte

Fixed. Any more suggestions?

Xenapte avatar Jun 30 '24 05:06 Xenapte