<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abdifatah Annaati on Medium]]></title>
        <description><![CDATA[Stories by Abdifatah Annaati on Medium]]></description>
        <link>https://medium.com/@Annaati?source=rss-58282e2a26f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UVhUg4BmakbFTSFK2H5Ceg.gif</url>
            <title>Stories by Abdifatah Annaati on Medium</title>
            <link>https://medium.com/@Annaati?source=rss-58282e2a26f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 16 Apr 2026 08:50:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Annaati/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Working with Dates in C#]]></title>
            <link>https://medium.com/@Annaati/working-with-dates-in-c-2829e0c3bbee?source=rss-58282e2a26f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2829e0c3bbee</guid>
            <category><![CDATA[datetime]]></category>
            <category><![CDATA[data-selection]]></category>
            <category><![CDATA[aspnet]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[csharp-dotnet-development]]></category>
            <dc:creator><![CDATA[Abdifatah Annaati]]></dc:creator>
            <pubDate>Sat, 06 Aug 2022 16:32:36 GMT</pubDate>
            <atom:updated>2022-08-06T16:35:48.870Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XS3YnzqS3hZR79xkMwGlKg.png" /></figure><p>Working with Dates is surely one of the most talked about and most important topic in any Programming language. Javascripts leads the way and it’s being said it’s the weirdest thing in javascript when it comes to working with Dates. I don’t have much understanding of Dates in javascript but it’s what I see or hear daily just like centering a div in CSS😀. Dates are the most talked topic and there is a reason.</p><p>Dates are an essential part of any system and it must be paid extra attention to. Messing or wrong use, validation or event format means a clear fault on the system. And then there comes time zones — which won’t even be talking about any further in this Article. When its comes to anything related to financial, dates are death wish so you must be extra careful unless you wrote your death wish — just joking🤗</p><p>In this Article we will be discussing working with Dates in C# in two crucial ways that could have a great impact on any system we develop.</p><p>When working with Dates, they are probably divided into two use cases so it is always good to be aware of which use case. It could either be Past Dates or Present/Future Dates. By Default C# Date selectors allow selecting Dates from Past, Present or future so it’s your job as Developer to customize the Date selector for the right use case.</p><p>As a matter of fact, the minimum date you can select from ASP-C# Date selector is <em>0001–01–01 as seen in the image below </em>and I don’t event know the Maximum selectable date, maybe its some millions years😶</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxnhs2apKPV6VERACABSBA.png" /><figcaption>ASP-C# minimum Selectable Date</figcaption></figure><p>In this Article we will be focusing on the two forms of dates which are:</p><ul><li>Min Date(Present &amp; Future Dates)</li><li>Max Date(Past Dates only)</li></ul><p>While we will be using C# alongside ASP.net (framework), they will work with any C-sharp-combinations regardless of what you combine with(be it ASP.NET Framework/Core, Pure C# or whatever as long as its C# code.</p><p>So without further ado let’s dive in and indulge them one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t82HoWRxBBX3YpnhX8uBuw.png" /><figcaption>ASP-C# Date selector UI</figcaption></figure><p><strong>NOTE: </strong>All The C# codes must be placed within the form code event/Method unless it’s directly related to another event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*CvUThbO9gdv37WlZvrZOwQ.png" /><figcaption>Form Load — where to place C# codes</figcaption></figure><p>By default, in Date selectors, you can select dates from past, present or future dates, see the pic below. It’s the developers’ job to customize it and allow only the right dates to be selectable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vt09zVGz-sPb_W1KMI1Ikw.png" /><figcaption>A Normal ASP-C# Date Selector</figcaption></figure><p>As you can see from the above image, you can select any date from past, current or future dates. Let’s customize it for several use case scenariors.</p><p>Throughtout this Article, I will be using <strong><em>yyyy-MM-dd</em></strong> date format which is the default MS SQL Server date format, feel free to format it according to your needs.</p><p><strong>Min-date Attribute</strong></p><p>Min-date is used in the scenarios where the to-be-selected date should be in present or future dates e.g Appointments. It allows only the dates from the specified dates and later to be selectable. let’s say you set the min-date to current date, this means that the dates from current or future dates are selectable. To customize the date selector for only current and future dates we add the below line of code in the C# (Codebehind). The min-date attribute is used to configure the date selector to allow current and future dates only.</p><pre>TxtDate.Attributes[&quot;min&quot;] = DateTime.Now.ToString(&quot;yyyy-MM-dd&quot;);</pre><p>where ‘TxtDate’ is the ID of the Date Selector control</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGN9But17D96lo16rkj5OQ.png" /><figcaption>Min-date Attribute</figcaption></figure><p>you can also set to a specific/custom date instead of the current date as illustrated below</p><pre>DateTime date = new DateTime(2022, 09, 01);</pre><pre>TxtDate.Attributes[&quot;min&quot;] = date.ToString(&quot;yyyy-MM-dd&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJTc27tSMG6xzuODlPmM2g.png" /><figcaption>Custom min-date Attribute</figcaption></figure><p>in the above example, the custom min date is <em>2022–09–01</em>, which means only dates from <em>1st of September, 2022</em> and after are selectable. you can customly set to any specific date as per required.</p><p><strong>Max-date Attribute</strong></p><p>Max-date is used in the scenarios where the to-be-selected date should be in past dates only, e.g birth dates. To customize the date selector for only past dates we add the below lines of code in the C# (Codebehind). You can customize it to only allow from a certain dates eg. <em>2000–01–01</em></p><pre>DateTime date = new DateTime(2000, 01, 01);</pre><pre>TxtDate.Attributes[&quot;max&quot;] = date.ToString(&quot;yyyy-MM-dd&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zYXNQ_BSdUIZFDMU_OAzw.png" /><figcaption>Max-date Attribute</figcaption></figure><p>As in the example, now only 2001–01–01 and before dates are selectable.</p><p><strong>Custom calculation</strong></p><p>In other scenariors, let’s assume you are building a system for a company, in the Employee registration, as per the Company’s policy, for an employee to be registered, he/she must be at least <em>20 years old. </em>In such cases is where custom cacluation comes. it is not only this specific exmaple scenarior, there are countles scenariors where custom calcluation has to be made.</p><pre>var currentDate = DateTime.Now;</pre><pre>TxtDate.Attributes[&quot;max&quot;] = currentDate.AddYears(-20).ToString(&quot;yyyy-MM-dd&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_eRrxA9SmkSKCbUmXEo8A.png" /><figcaption>Cutsom max-date Attribute</figcaption></figure><p>the above calcluation and alike can be done with the <em>min-date attribute </em>as well.</p><p><strong>Sample Use case scenarios</strong></p><p>To be clear these sample use cases are just a few I can remeber from the top of my head at the time of writing, there surely countless others, feel free to mention them below</p><p><strong>Min-Date</strong></p><p>The Min-Date has several use case scenarios to a name a few of the name are:</p><p>Bookings (Check-in &amp; check-out), Schedules, Appointments &amp; etc.</p><p><strong>Max-Date</strong></p><p>The Max-Date has several use case scenarios like</p><p>Date of Birth, Produced date,</p><p>It’s a good practice to be aware the use case of the date selector to customly suit it. So always ask yourself the use case in wherever you come across a date selector next time.</p><p><strong>It’s a pro Tip</strong></p><p>I Called these two pro tips to save you from embarrassing or awkward situations and here is why</p><p>Imagine what an embarrassment it is to register an employee’s date of birth as of 2022–070–31 which means as of writing this article this article the Employee hired is 3 days old. The system developer should be aware of</p><p>On the other hand imagine its a Booking or schedule form and the user selects 2022–01–01 as the chick-in or so called begin date from the date selector. Who is to blame for here, well it’s 100% the system developer.</p><p>As system developers, we must always pay special attention to what the user can input into our system and dates hold special cases for this. so always check that only their right inputs are available in case of a select field and only right input is allowed in case of a normal input field.</p><p><strong>Conclusion</strong></p><p>As discussed earlier Dates for crucial part of any System so the correct use of them means saving yourself and your professional from embarrassment and most importantly saving your system from unnecessary logic errors.</p><p>before we wrap up, here is the big questions, have ever come messed up with dates or faced an embarassing moments?</p><p>For me yes, I remember in my fourth Semester, I was perfoming employee registration end-Semester Project when the Lectureral basically told me to select current date as date of birth and it happened, I pinched myself and told how can’t you remember such silly things. from that day on, I never trusted date selectors again😀. there are also many such case I have seen happen to someone else.</p><p>Now some of you may say why not validate on Save button click?</p><p>Well you can, but its better to leave out at first rather then to force the use to change inputs. why waste time, just leave out the un-neccessary task.</p><p>feel free to share yours.</p><p>And If you found it helpful, give it what it deserves, remember to share it with others who may benefit from it. finally if you would like to connect with me or just want to know What I’m working or upto , I would Love to, You can find me on on<a href="https://twitter.com/Annaati17"> <strong>Twitter</strong></a> as well as<a href="https://www.linkedin.com/in/Annaati/"> <strong>Linkedin</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2829e0c3bbee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top VSCode Extensions: 2022 Edition]]></title>
            <link>https://medium.com/@Annaati/top-vscode-extensions-2022-edition-35995d09eb4e?source=rss-58282e2a26f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/35995d09eb4e</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[extension]]></category>
            <dc:creator><![CDATA[Abdifatah Annaati]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 19:53:02 GMT</pubDate>
            <atom:updated>2022-08-05T20:09:38.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*heYqS07nWXiXo1ftHxPcIA.png" /></figure><p>There are surely great Text Editors out there but VSCode is one of the best if not the best, a lightWeight yet Powerful Text/Code Editor suitable when you don’t want to bear the heavy weight and complexity of IDEs. And VSCode Extensions help you level up your productivity. Here I have Compiled 21of the Top VSCode Extension to take advantage of and uplevel your Productivity to the next level.</p><h3><strong>1. Settings sync</strong></h3><p>The first and maybe most important step in your VSCode journey should start with Settings sync because you don’t want your VSCode Settings, Customization, etc to start from scratch on every new device or even when you re-install VSCode. Customize once and sync in with Github then use anytime on any device.</p><h3><strong>2. Language Specific Snippets</strong></h3><p>For almost every Programming language/Framework/Library, There is an Extension for quick snippets like code completion, correction, syntax &amp; more.</p><p>There are also some general ones like Emmet which is built in Snippet that supports html, haml, pug, slim, jsx, xml, xsl, css, scss, sass, less and stylus.</p><h3><strong>3. Prettier</strong></h3><p>Keep your code style clean and consistent format/alignment. It helps auto code format. It also helps fix irregular use of single(‘’) and double(“”) quotes and semicolons (:)</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"><strong><em>Prettier</em></strong></a> Marketplace</p><h3><strong>4. GitLens</strong></h3><p>View When, How and Who code changed and explore the evolution and history of your codebase right inside VScode. It shows the last commit and its author on the status bar.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"><strong><em>Gitlens</em></strong></a> Marketplace</p><h3><strong>5. Code Time</strong></h3><p>Do you ever wonder how long you spend coding? Code Time is All you need. It helps you keep tracking your Coding time.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=softwaredotcom.swdc-vscode"><strong><em>Code Time</em></strong></a> Marketplace</p><h3><strong>6. Live Server</strong></h3><p>Hitting Refresh on the Browser when you want to preview changes is boring. This extension launches Local Development Server with a hot reload on save. That means you will instantly see changes on the browser without refresh</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer"><strong><em>Liver Server</em></strong></a> Market place</p><h3><strong>7. Live Share</strong></h3><p>Do you need to Pair-Programme or even Collaborate with others in real-time Coding, Editing, debugging, remote code reviews &amp; etc. Then Live Share is here for you. It even has integrated audio and text chat.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-audio"><strong><em>Live Share</em></strong></a> Marketplace</p><h3><strong>8. VSCode-Icons</strong></h3><p>Icons help you visual files and Folders. Files are automatically marked with their language.</p><p>There are also other extensions for Icons in VSCode Extension MarketPlace among them are:</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons"><strong><em>VSCode-Icons</em></strong></a><strong><em>, </em></strong><a href="https://marketplace.visualstudio.com/items?itemName=ShaneLiesegang.vscode-simple-icons-rev"><strong><em>Simple Icons</em></strong></a><strong><em> and </em></strong><a href="https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme-icons"><strong><em>Material Theme Icons</em></strong></a> Marketplace</p><h3><strong>9. Colorize</strong></h3><p>Colorize makes it very easy to visualize at a glance which colors you’re using where on CSS colors in your CSS/SASS/Less/etc.</p><p>Visit<a href="https://marketplace.visualstudio.com/items?itemName=YuTengjing.vscode-colorize-plus"><strong><em> Colorize</em></strong></a> Marketplace</p><h3><strong>10. Peacock</strong></h3><p>Do you have multiple workspaces or Work on multiple codebases simultaneously? Peacock helps you visualize them by choosing different colro for each one.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock"><strong><em>PeaCock</em></strong></a> Markeplace</p><h3><strong>11. CSSPeek</strong></h3><p>For Frontend Devs as the Project grows, finding the right CSS Code becomes harder. Allows you to quickly jump to the right CSS code if you know the class or ID name</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=pranaygp.vscode-css-peek"><strong><em>CSS Peek</em></strong></a> Marketplace</p><h3><strong>12. Remote-SSH</strong></h3><p>This Extension lets you work on code from a remote machine directly from your VSCode terminal.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh"><strong><em>Remote-SSH</em></strong></a> Marketplace</p><h3><strong>13. Markdown All In One</strong></h3><p>As the name suggests, it’s for Markdown and it helps you with many things like syntax, auto-complete, auto-preview, etc. There is also MarkDownLint.</p><p>Vist <a href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one"><strong><em>Markdown All in One</em></strong></a> Marketplace</p><h3><strong>14. Code Spell Checker</strong></h3><p>Typos in code aren’t a good impression even though they aren’t life threatening😜. This Extension helps Checking typos in your code. It’s available for many languages.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker"><strong><em>Code spell Checker</em></strong></a> Marketplace</p><h3><strong>15. Import Cost</strong></h3><p>Track and keep record of the estimated size of an import package. It even shows you a warning if the imported package is too large. You can configure it according to your requirements.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost"><strong><em>Import Cost </em></strong></a>Marketplace</p><h3><strong>16. Relative Path</strong></h3><p>Are you tired of Path Imports? Relative Path is what you need. Just type in the file it will import from its right path unless you have files with the same name.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=jakob101.RelativePath"><strong><em>Relative Path</em></strong></a> Marketplace</p><h3><strong>17. Debugger for Chrome</strong></h3><p>Allows you to debug your JS Code inside VSCode code. You can set breakpoints, step your way through the code</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome"><strong><em>Debugger for Chrome</em></strong></a> Marketplace</p><h3><strong>18. TODO Highlight</strong></h3><p>How do you write and keep track of your todos in Coding? Don’ts tell me as Comments😃.</p><p>Well That is where TODO Highlight comes in. Toggle, Highlight, Annotation and much more.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight"><strong><em>TODO HightLight</em></strong></a> Marketplace</p><h3><strong>19. Better Comments</strong></h3><p>Do you find Gray Color of your comments boring? Well Why not Take it to the next level with Better Comments by Styling as like a pro😎</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments"><strong><em>Better Comments</em></strong></a> Marketplace</p><h3><strong>20. Auto Rename and Auto Close Tag</strong></h3><p>I bet there were several times when you renamed or changed an opening tag then you forgot the closing tag. These 2 extensions are there for you, they got your back😊</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag"><strong><em>Auto-Rename-Tag</em></strong></a><strong><em> </em></strong>or<strong><em> </em></strong><a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag"><strong><em>Auto-Close-Tag</em></strong></a> Marketplace</p><h3><strong>21. Regex Previewer</strong></h3><p>Who else hates Regular Expressions in Code😉, Well I decided to make this one the last. This Extension helps you write Regular expressions in JS, TS and Php easily and accurately by showing you side documentation, multiple examples, etc.</p><p>Visit <a href="https://marketplace.visualstudio.com/items?itemName=chrmarti.regex"><strong><em>Regex Previewer</em></strong></a> Marketplace</p><h3><strong>Conclusion</strong></h3><p>Last but not the least, Remember that you can customize all these extensions to suit your way and Documentations are availabe in their respective Marketplace. and once again remember while many of these are exensions are general purpose some of them are Language specific which may effect other language code-base so its always better to set up a workspace and install language specific exensions only in their respective programming languages.</p><p>And If you found it helpful, give it what it deserves, remember to share it with others who may benefit from it. finally if you would like to connect with me or just want know What I’m working or I’m upto , I would Love to, You can find me on on<a href="https://twitter.com/Annaati17"> <strong>Twitter</strong></a> as well as<a href="https://www.linkedin.com/in/Annaati/"> <strong>Linkedin</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35995d09eb4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>