« first day (4184 days earlier)      last day (986 days later) » 

09:18
Hi, I need to convert an Awsdatetime to user read string.
from this "2022-03-27T14:33:31.550Z"
    to this "27 March 2022"
Any idea?
|| mdn Intl DateFormatter
Didn't mean to edit my last message but anyway - the two links are relevant.
HEllo, can someone here help me with AngularJS...Thanks
09:42
|| justask
in C#, Aug 28, 2017 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
10:37
@VLAZ Thanks, but it's not clear...
const date = new Date(Date.UTC(2020, 11, 20, 3, 23, 16, 738));
console.log(new Intl.DateTimeFormat('en-US').format(date));
//"12/20/2020"
but with Awsdatetime like 2022-03-27T14:33:31.550Z I tried:
console.log(new Intl.DateTimeFormat('en-US').format("2022-03-27T14:33:31.550Z"));
||> console.log(new Intl.DateTimeFormat('en-US').format(new Date("2022-03-27T14:33:31.550Z")));
@VLAZ 'Error: Script execution timed out.' Logged: [ ] Took: 1043ms
You need a Date object
But it's not the en-US formatting you probably want.
||> console.log(new Intl.DateTimeFormat('en-US').format(new Date("2022-03-27T14:33:31.550Z")));
@VLAZ undefined Logged: [ '"3/27/2022"' ] Took: 45ms
Dunno why it timed out the first time
10:47
VLAZ, JamesBot ♥ thanks!
11:23
fyi, you don't have to console log it
||> new Intl.DateTimeFormat('en-US').format(new Date("2022-03-27T14:33:31.550Z"))
@KarelG '3/27/2022' Logged: [ ] Took: 1ms
also ... @SimonOrro he has used a new Date constructor with a string as an argument, as part of an example. This is something you should not do in production. Either use the other constructor (with numbers) or use a date library if you have to work a lot with it
@KarelG Would require me more effort than copy -> paste -> fix the code
I'd also have to delete stuff.
And who has time for that?
@KarelG The string is absolutely valid for the date constructor.
It's the precise IS8601 format that JS supports by spec.
32
Q: What are valid Date Time Strings in JavaScript?

strWhen using new Date or Date.parse in JavaScript, I cannot just pass arbitrary date formats. Depending on the format, I get a different date than I wanted to or even Invalid Date instead of a date object. Some date formats work in one browser but not in others. So which date time formats should I ...

I'd encourage people to use that for constructing Date objects. It's easier to read and it's officially supported.
Less ambiguous, as well. Erm, unless you compare date strings and datetime strings. Those interpret using different time zones. And don't omit the time zone in a datetime string.
11:44
yes, you are correct. But many have used it with a non-ISO 8601 compliant date strings and wondered why it gives an "odd" result
and that's a thing many aren't aware of. So I just tell "better to not use it directly"
@VLAZ oh come'on :) there's room for selection!
@KarelG I get the feeling you expect me to put any sort of effort
12:36
:P
btw, @VLAZ since you're here often ... do you mind to be a RO?
I suppose I don't mind. It's not a position I'd have petitioned for but there isn't too much I need to do.
I would probably need to watch out more for disruptions but that doesn't happen really often.
true, but it gives you a means to move messages to other rooms if applicable
Hi, I am trying to group rows in angular. is anyone available?
table rows?
12:53
IIRC (been a while that I have used angular) it was not supported by mat-table
Not sure if they patched that after
@karan does the provided answer not work?
not working
I can see in console array items are grouped
but not knowing how to display in template
I used this code
@karan Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
13:19
@KarelG Which I'd be happy to do.
14:06
@KarelG I'd support
chat.stackoverflow.com/transcript/message/54274977#54274977 @KevinB / @BenFortune is it okay for you as well? (I would be surprised lol)
TIL excel can be a good coding platform; excelunusual.com
You can make an issue on GH to nominate VLAZ
👍
i haven't actually needed to do anything as an RO in quite a while
ya little activity
tbh, i'm not sure SO is the go-to place anymore, so SO chats aren't the auxiliary go to chat
Every language/framework/topic seems to have their own communities in mostly Discord servers
 
2 hours later…
16:16
Might be a weird question but does somebody have a good reference for coding conventions for TS?
I'm trying to write ones for work, I want to make sure I don't miss out or overdo parts.
16:30
@VLAZ wanna try Google's style guide? google.github.io/styleguide/tsguide.html
ironically, I'd probably fail to comply if any of my codebases were to be checked - I only recently realised that you can specify type parameters at init time directly like new Map<number, User>, so it's riddled with const umap: Map<number, User> = new Map();
I don't think it's fair to expect your code to comply with any specific coding guideline. It might but parts of the guidelines are opinionated. So, it's hard to match up exactly.
Our codebase fails at the very beginning. Because enums are not named in CAPS_WITH_UNDERSCORES. But that's fine, since they still follow a convention. Erm, well, maybe three different conventions but they follow them.
@VLAZ I actually like Google's coding style and generally follow it to the letter, what I meant is there are still some areas of TS that keep surpizing me (and I claim to have a very good level of understanding of TS) :)
I'm certain their style is sensible. I'm currently looking through it. However, you can have many equally sensible styles which are incompatible, is what I'm saying.
yup, won't argue with that
@VLAZ I usually gravitate to the "all caps with underscores" style when naming enum members to have an easy indication that those aren't just interface members but proper enums, but yeah, as long as the naming choice is consistent, it does not really matter
We use SomeNameType for enums in C#. And some of the TS codebase also uses it. Other part of the codebase instead uses SomeNameEnum which I'm iffy on. It does make it clear what it is but I don't like adding the type of the thing in the name of the thing.
16:45
@VLAZ Custom ESLint/Prettier config is usually a good start
@VLAZ ugh, I am not a big fan of the Hungarian notation, you know
@JBis We actually have that. Which alleviates a lot of the work for a styleguide. There is just one point that says "Make sure you use the linter configuration". Instead of having to define the nitty-gritty.
16:56
Not sure I'd agree with not using regular functions. I guess they are very rarely needed nowadays but outright banning them doesn't seem correct.
I agree even less with not using arrow function properties. Yes, you probably should avoid it but when you know you have one single instance of a thing (or 2-3) then the extra memory for those function is not an issue. Which you might want if you do class Foo { refresh = debounce(() => /* ... */, 25) } or similar.
@VLAZ eh, that part is opinionated a bit. Generally, I agree with outright banning function - there are extremely few cases where one might want to use it. However, there are, indeed, cases, where one would want function over arrow functions. Great case in point is Mocha where test env overrides only exist as methods on this, so if you want to say "well, this test is going to take longer than usual" in a describe or it block, you will have to use function
17:16
o/
o7
Howdy
posted on March 31, 2022 by Harry Souders

Hi, everyone! We've released Chrome Beta 101 (101.0.4951.17) for iOS: it'll become available on App Store in the next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

@VLAZ yes, the only time I still find "static" classes to be useful is in god-forsaken environments with no proper module system. And even then I usually get a nagging question in my head "why not just use functions?"
17:32
@OlegValteriswithUkraine I've said this before (in another room) but static classes are a sign of weakness in OOP. Because it cannot really model an operation not attached to an instance. Which is what a function is. Hence you get that static class. And those exist in Java and C# because both languages just don't have a concept as a top level function.
I feel in TS the "static classes" come from people familiar with languages like Java/C# and thus locked into that paradigm.
@VLAZ oh, I completely agree
@VLAZ we should be thankful the team does not fancy the static class proposal :)
There is a great quote from uncle Iroh in Avatar: The Last Airbender:
> It is important to draw wisdom from many different places. If we take it from only one place, it becomes rigid and stale.
Backend developers trying to write JS/TS fall victim to that often.
Also JS/TS developers who pick up backend.
And in general developers who only use one language and try another.
reading this article here: yetanothersharepointblog.wordpress.com/2013/07/14/… . This guy is having the same issue as me with user's getting different results due to the time zone. I was reading the answer he found that worked for him, I checked and the regional settings are in UTC. He doesnt really explain what fields he uses or where the self.toUTC (self) came from
> I created the following method to ‘Adjust’ my dates before sending them to sharepoint so that they would be stored in the database with the 00 hour
And then it shows the code for from and toUTC
Also, it's very funny that the code in the article contains debugger;
Haha I noticed that debugger;
So the input date should be for the JavaScript dates I am creating to search/filter from SharePoint results?
17:40
@VLAZ especially since JS provides so many great ways to shoot oneself in the foot with by applying knowledge from other languages to it
@OlegValteriswithUkraine Yes. There are many questions on SO about "how do I do this thing" which hinge on trying to emulate something from another language and searching for the equivalent. Instead of searching for the proper way to do it.
The fromUTC is from sending dates to the SharePoint server, I am guessing VIA a POST? I am not sending any dates like that, I am just reading them to filter certain results
Not only a problem for JS but that's the room we're in.
@BeerusDev Yes, it seems fromUTC is for sending, toUTC is for receiving. The problem seems to be that the dates are just saved (or transmitted?) in a garbage format since they miss the time zone.
Which, you know, is an issue if you want accurate dates.
Well they are stored by locale. So any user in a different time zone reads the result differently. Super annoying, didn't expect to run into this problem until a user from the west coast started experiencing issues with something I built
Welcome to the world of time...
I'll give it a read
there can't be a date storing/retrieval discussion without a reference to it :)
I took some security at Uni. We were talking about incident response if you are (for some reason) called to examine a PC involved in crime. The first and more crucial thing to do my lecturer said was to take a note of the time on the PC. Since if it's running in a different time zone, you want to be able to adjust the logs later when reading them.
It's not really much different outside of investigating crime.
It is super fucking important to use time zones whenever we deal with time.
2
Recently we had a discussion at work revolving around "good logging practices" and I apparently surprised everybody by reminding them to add the time zone to the logs. Even though we operate on two time zones and we often juggle dates between them. In fact, depending on which log you look at you might see one or the other time zone. And occasionally we have a third one which is UTC.
Trying to figure out if 12:43 is before or after 12:40 where both of these come from different logs is annoying.
i mean, just looking at the numbers, i'd say 12:43 is after 12:40
18:28
posted on March 31, 2022 by Prudhvikumar Bommana

The Chrome team is excited to announce the promotion of Chrome 101 to the Beta channel for Windows, Mac and Linux. Chrome 101.0.4951.15 contains our usual under-the-hood performance and stability tweaks, but there are also some cool new features to explore - please head to the Chromium blog to learn more! A full list of changes in this build is available in the log. Interested in switching

 
1 hour later…
19:34
posted on March 31, 2022 by Srinivas Sista

 The Dev channel has been updated to 102.0.4972.0 for Windows,Linux and Mac A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Srinivas Sista Google Chrome

20:17
            render: function(data, type, row) {
            if (type === "sort" || type === "type") {
                return data;
            }
                return moment(data).format("M/D/YYYY");
            }
Didn't mean to paste that
I hate design
specifically colors/themes
coming up with them, that is
Like UI?
It is rather difficult to come up with a good design
i'm recreating an existing app that was built in another language and had a very... not accessible design
dark controls on black backgrounds, white text on light backgrounds, etc
20:22
Drawing it out on pencil paper to brainstorm helps
which means i'm effectively starting from scratch
the layout is already set in stone, i'm more working with button styles, borders, shadows, gradients, textures, etc
Don't copy, steal
20:46
posted on March 31, 2022 by Erhu Akpobaro

Hi everyone! We've just released Chrome Beta 101 (101.0.4951.15) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Erhu Akpobaro Google Chrome

21:15
@KevinB Not if it's 12:43+02:00 and 12:40+01:00, for example. Then the second one is after the first one because if you transform them to the same time zone, you get 11:43+01:00 and 12:40+01:00. That's the problem with not knowing which time zone a log is in.
@VLAZ in the absense of data, you can only work with the data available
That was my point. The data is that some timestamps are in a different time zone. But without the time zone information, you have to guess. I mean, not too much, but if you only have the logs without their source you don't know exactly which time is in which time zone. And if you're trying to find a problem you want to find the correct timestamp in them.
22:20
🧟‍♂️ ⏱️

« first day (4184 days earlier)      last day (986 days later) »