It is currently December 1st, 2021, 7:36 pm

Enigma Google Calendar Patch

A package of skins with a "theme" or by a single author
markpud
Posts: 7
Joined: December 11th, 2017, 6:35 pm

Re: Enigma Google Calendar Patch

Post by markpud »

balala wrote: March 8th, 2021, 7:29 pm There might be setting in the Settings skin (Enigma\Options\Options.ini), but I didn't find it, so I'm gonna describe you how to make manually the needed adjustments.
You have to work with the Enigma\Taskbar\Clock\Clock.inc file. All clock skins of the Enigma\Taskbar\Clock config will get the new format. So open the above Clock.inc file and look for and replace the Format option of the [MeasureText] measure (Format="%#I.%M") by Format=%#H.%M. Note that beside replacing the I format option by H, I did remove the absolutely not-needed quotes as well.
Thanks.. I'm using the standalone version without Enigma, but I found the equivalent options in \@Resources\Measures\Reader.lua

Under function Output() I changed this line:

local Timestamp = SELF:GetOption('Timestamp', '%I:%M %p %A %b %d')

to

local Timestamp = SELF:GetOption('Timestamp', '%H:%M %A %b %d')
User avatar
balala
Rainmeter Sage
Posts: 13511
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

markpud wrote: March 9th, 2021, 1:23 pm Thanks.. I'm using the standalone version without Enigma, but I found the equivalent options in \@Resources\Measures\Reader.lua

Under function Output() I changed this line:

local Timestamp = SELF:GetOption('Timestamp', '%I:%M %p %A %b %d')

to

local Timestamp = SELF:GetOption('Timestamp', '%H:%M %A %b %d')
Not sure what you mean by "standalone version without Enigma", however I'm glad if you succeded. :thumbup:
markpud
Posts: 7
Joined: December 11th, 2017, 6:35 pm

Re: Enigma Google Calendar Patch

Post by markpud »

I don't have the enigma skin on my system at all.. The OP has 2 versions, I installed the 2nd one which is based on Enigma Gcal but is standalone :)
User avatar
balala
Rainmeter Sage
Posts: 13511
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

markpud wrote: March 9th, 2021, 2:42 pm I don't have the enigma skin on my system at all.. The OP has 2 versions, I installed the 2nd one which is based on Enigma Gcal but is standalone :)
Alright. But now it does work in 24-hour format, right?
markpud
Posts: 7
Joined: December 11th, 2017, 6:35 pm

Re: Enigma Google Calendar Patch

Post by markpud »

Yes, thanks again for your help :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 13511
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

markpud wrote: March 9th, 2021, 3:17 pm Yes, thanks again for your help :thumbup:
You're welcome.
theworkaroundguy
Posts: 1
Joined: July 7th, 2021, 7:55 pm

Re: Enigma Google Calendar Patch

Post by theworkaroundguy »

I managed to find a work around to the recurrent event time displacement anomaly vortex issue.

I didn't spend much time on it so its not very elegant. Basically, you add "RPT" at the end (or anywhere) in the title of a repeating event. You can obviously change RPT to anything, set by rpt_tag. It will offset the time by the amount specified in rpt_correction, which you will need to determine what value is required for you (I was 4 hours off).

in Reader.lua, add

line 1, add

Code: Select all

repeat_event = false
rpt_tag = "RPT"
rpt_correction = 4

line 126 ish, add portion between ADD THIS HERE -> END ADD

Code: Select all

 for RawItem in Raw:gmatch(Type.MatchItem) do
                       
                       	local Item  = {}
 
                        -- MATCH RAW DATA
                        Item.Unread = 1
						
			if (t == 'iCalendar') then
                       		Item.Title  = RawItem:match('SUMMARY:(.-)\n') or nil
                       		
                       		
                                
                        	if (string.len(Item.Title) == 1) then
                                        Item.Title = RawItem:match('DESCRIPTION:(.-)\n') or nil
                                end
                                Item.Title = Item.Title:gsub('\\', '')
                        else
                                Item.Title  = RawItem:match('<title.->(.-)</title>') or nil
			end
			
			
			-- ADD THIS HERE
               		if string.find(Item.Title, rpt_tag) then
               			repeat_event = true
       			else
       				repeat_event = false
       			end
       			-- END ADD

			Item.Date   = RawItem:match(Type.MatchItemDate)      or nil
line 640 ish, add portion between ADD THIS HERE -> END ADD

Code: Select all

function IdentifyDate(s, t)

	local Date = nil
	
	Date = s and Types[t].ParseDate(s) or {}

	Date.year   = tonumber(Date.year)  or nil
	Date.month  = tonumber(Date.month) or MonthAcronyms[Date.month] or nil
	Date.day    = tonumber(Date.day)   or nil
	Date.hour   = tonumber(Date.hour)  or nil
	Date.min    = tonumber(Date.min)   or nil
	Date.sec    = tonumber(Date.sec)   or 0

	-- ADD THIS HERE
	if repeat_event then
		Date.hour = Date.hour + rpt_correction
	end
	-- END ADD

	-- FIND ENOUGH ELEMENTS, OR DEFAULT TO RETRIEVAL DATE
	local RealDate, AllDay

	if (Date.year and Date.month and Date.day) then
		RealDate = 1