Skip to content

Commit

Permalink
Added method to get current time, add timestamp to generated script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaguar-515 committed May 29, 2020
1 parent f0c6cdd commit 1dbf497
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@

# Roblox model files
/*.rbxmx
/*.rbxm

# Secret module containing API key(s)
APIKeys.lua
/*.rbxm
4 changes: 4 additions & 0 deletions modules/GetCurrentDate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return function()
local date = os.date("*t", os.time())
return date.year.."-"..date.month.."-"..date.day.."T"..date.hour..":"..date.min..":"..date.sec.."Z"
end
3 changes: 2 additions & 1 deletion src/Components/ConvertButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local HttpService = game:GetService("HttpService")

local Roact = require(script.Parent.Parent.Parent.Libraries.Roact)
local PrettyPrint = require(script.Parent.Parent.Parent.Modules.PrettyPrint)
local GetCurrentDate = require(script.Parent.Parent.Parent.Modules.GetCurrentDate)

local function ConvertButton(props)
return Roact.createElement("TextButton", {
Expand Down Expand Up @@ -32,7 +33,7 @@ local function ConvertButton(props)
local OutputScript = Instance.new("ModuleScript")
OutputScript.Parent = game.ReplicatedStorage
OutputScript.Name = "Output"
OutputScript.Source = "-- generated by ConvertJSON\nreturn "..tostring(PrettyPrint(Output))
OutputScript.Source = "-- generated by ConvertJSON at "..GetCurrentDate().."\nreturn "..tostring(PrettyPrint(Output))

print('generated output script in '..OutputScript.Parent.Name)
element.Parent.Message.Text = "generated output script in "..OutputScript.Parent.Name
Expand Down

0 comments on commit 1dbf497

Please sign in to comment.