Jump to content

Issues with Timezones in FormatDateTime? Panel Transparency?


Recommended Posts

I am here in Chicago, IL, USA and I have a clock app that is just for fun and is a work in progress.

When I use FormatDateTime ('h:nn:ss am/pm', Now) the AM/PM indicator returns AM when the time is 12:00 pm to 12:59 pm at 1:00 pm the AM/PM indicator then works correctly and returns PM when expected. I'm assuming it does the same thing but swapped for the 12:00 am to 12:59 am period.

I watch this here at https://www.harmonicmix.com/clock which is a SMS built app. This is a testing app for various features and I'm guessing that the browser Javascript runtime is providing the date time correctly, I'm guessing it is a bug in the FormatDateTime function or some constants somewhere.

Second, for the Clock app, you can notice that the two panels (Yellow set to alTop) and the centered gray panel is being positioned in the Resize function to keep it centered horizontally and vertically. However, I'd like all these panels to eventually be transparent instead of colored. Is this a CSS customization or can I do something in SMS to adjust this. I tried to mess with the opacity property, but that didn't seem to be what I was looking for.

The top time field and bottom date field are TW3Label objects that are automatically transparent.

Thanks.

tim

Link to post
Share on other sites

OK, I fixed the transparency item by adding some tags to the style to override other CSS it was inheriting. I created a function that can automatically add these tags to any panel the I might need this.

 

procedure TFormClock.TransparentPanel(APanel: TW3Panel);
begin
  w3_setstyle(APanel.Handle, 'background', 'transparent');
  w3_setstyle(APanel.Handle, 'outline', 'none');
  w3_setstyle(APanel.Handle, '-webkit-box-shadow', 'none');
  w3_setstyle(APanel.Handle, 'box-shadow', 'none');
  w3_setstyle(APanel.Handle, 'border', 'none');
end;

 

Link to post
Share on other sites
  • Administrators

First of all, that's a beautiful clock. Looks very nice 🙂

I can reproduce the AM/PM -bug, so let me have a look at it.

Transparency can be controlled with normal properties like this:

Ctrl.AlphaBlend:=True;
Ctrl.Opacity:=0;

You can also make your procedure more versatile, so it can be used with any control:

procedure TFormClock.TransparentControl(ACtrl: TW3CustomControl);
begin
  w3_setstyle(ACtrl.Handle, 'background', 'transparent');
  w3_setstyle(ACtrl.Handle, 'outline', 'none');
  w3_setstyle(ACtrl.Handle, '-webkit-box-shadow', 'none');
  w3_setstyle(ACtrl.Handle, 'box-shadow', 'none');
  w3_setstyle(ACtrl.Handle, 'border', 'none');
end;

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...