Skip to main content

· One min read

It was my first ever experience to participate in Microsoft's event outside Sri Lanka. My experience as a “first-timer” attending the South East Asia's MVP community connection, along with few other MVPs from my country. MVP Community Connection is a day to connect, learn, inspire and celebrate the local MVP community and MS employees.

It was an exclusive event especially organized for Asia pacific MVPs. The intention is to have all MVPs from different region join there and have a great time with others. There were some interesting sessions and networking between each other. 

From the moment I got off the plane at the Soekarno–Hatta International Airport Airport, I was very excited about the event. I was the first to arrive AYANA Midplaza JAKARTA 2 hours prior to the event. From the registration, greeted by Microsoft mvp tshirt and  I was escorted to pick up my personal registration badge and Wahoo!. 

· One min read

1/03/2017 was a huge day in my career as I was awarded my first (and hopefully not the last) Microsoft Most Valuable Professional award under the category Visual Studio and Development Technologies. It was such a  Indescribable honor, and i have to give a shout out here to the Microsoft community for their support. There have been so many great mentors/supporters in my career over the past 6  years.Thank you  MVP Community Program Manager, my friends, colleagues, my company,followers and supporters for helping me to get my Microsoft  MVP Award for this year.

I hope this marks only the beginning of this new phase of my professional life and I feel so very lucky to be among the 6 technology leaders under the same category in Sri Lanka. Microsoft has always been a great supporter of the community, and a real partner in our ongoing efforts. I will make sure to work extra hard to give back (even more) to the community and I will be more glad to do it every day! Thank you Microsoft!Thank you to the MVPs who welcomed me and others have helped me throughout the years!

· 2 min read

It has been an amazing journey for Microsoft Visual studio , Recently marking 20 years of software development tool in the industry. Tech giant Microsoft has introduced the discharge of Visual Studio 2017. Users can obtain visual Studio 2017 by visiting https://www.visualstudio.com/.

Every Visual studio fan would have been excited about the release of Visual Studio 2017. Let's see what Visual Studio 2017 offers us ahead of the previous versions.

Testing and Debugging:

Visual Studio 2017 gives the developers debugging experience to identify the source of an issue faster with the following things,

The new Exception Helper

Run To Click

XAML Edit and Continue

Reattach To Process

Open for everyone:

Last but not the least, there is a FREE community version that everyone can try. Also
if you get  60 days of Xamarin University free if you download before 14 March 2017.

Here's a quick rundown of all the features that have arrived on the Visual Studio 2017:

Better startup and load time
Modified navigation with new features
Visual C++
Extended support for C# 7.0 and Visual Basic
Support for F# 4.1 language
Live Unit Testing
Introduction of Git features
Enhanced Visual Studio Feedback Workflow
Inclusion of .NET Core and ASP.NET Core libraries
Xamarin 4.3 support
NuGet support
Azure SDK for .NET
Office Developer Tools for Visual Studio
Developer Command Prompt
Installation Nickname, and other IDE improvements

So, what you are waiting for? Start to download Visual Studio 2017 and check out what's new? You will feel glad  as how i am. Cheers!

· 2 min read

Recently i was developing an application in angular2 where i had to use a calendar which shows the results for this month, this week and this weekend. I was finding a solution in pure javascript but it was time consuming. I decided to go on with moment.js , this is how i have embedded moment with angular2 application.

Step 1 : npm install moment --save

Step 2 : In your systemjs.config.js file's map array add:

'moment': 'node_modules/moment'

to packages array add:

'moment': { defaultExtension: 'js' }

Step 3 : In your component.ts use: import * as moment from 'moment/moment';

and that's it. Now you should be able to use moment with your application.

Example:

public setDate(term: string) {
var status: string;
status = term;
switch (status) {
case "today":
this.fromDate = moment().toDate();
break;
case "tomorrow":
this.fromDate = moment(new Date()).add(1, 'days').toDate();
break;
case "weekend":
this.fromDate = moment().startOf('week').add(6, 'days').toDate();
this.toDate = moment().startOf('week').add(7, 'days').toDate();
break;
case "thisweek":
this.fromDate = moment().startOf('week').toDate();
this.toDate = moment().startOf('week').add(7, 'days').toDate();
break;
case "nextweek":
this.fromDate = moment().startOf('week').add(7, 'days').toDate();
this.toDate = moment().startOf('week').add(14, 'days').toDate();
break;
case "thismonth":
var date = new Date(), y = date.getFullYear(), m = date.getMonth();
var firstDay = new Date(y, m, 1);
var lastDay = new Date(y, m + 1, 0);
this.fromDate = moment(firstDay).toDate();
this.toDate = moment(lastDay).toDate();
break;
}
}

· One min read

I came across this question on stackoverflow to allow the user to type only specific numbers such as 3,6,9,12 and so on. You can use the following directive which checks for the key and allows as input.

Directive Code

 angular.module('demo').directive('restrictTo', function() {     return {       restrict: 'A',       link: function (scope, element, attrs) {         var include = /3|6|9|12/;         element[0].addEventListener('keydown', function(event) {           if (!include.test(event.key)) {             event.preventDefault();           }         });       }     }   });  

Demo:

https://plnkr.co/edit/oogjTylyl2MTS91nFyxk?p=preview

Also we can use the ng-pattern as follows,

 input name="numberField" type="number" data-ng-model="model.number" data-ng-pattern="/^(3|6|9|12|15)$/"/>