DATEDIFF two dates 1 year apart

For a friend who needed to know how to check if two dates in Sybase ASE 12 are a year apart.

A JavaScript Solution

Add moment.js lib

// TODO: Validate if date diff is no more than 1 year
var startSepDt = moment($('#startDateSep').val());
var endSepDt = moment($('#sendDateSep').val());
var dateDiff = endSepDt.diff(startSepDt, 'year');
if (dateDiff > 1) 
{
       showInValidSeasrchWarning('The date range cannot exceed a year.');
       return false;
}

 

A SQL Solution

-- DATEDIFF two dates 1 year apart
DECLARE @year1 datetime, @year2 datetime
SET @year1 = DATEADD(year,-1,GetDate())
SET @year2 = GetDate()
SELeCT @year1, @year2, datediff(year,@year1,@year2) 
if( datediff(year,@year1,@year2) <= 1 AND datediff(dd,@year1, @year2) <= 365 )
print 'Hurray! Within one year..'
else
print ':( Difference is more than a year'

Android Nano Degree resources

Read your first Android blogpost article

Start by reading this post on the Android Developers blog. It’s written by Google Design Advocate, Roman Nurik, who was the lead designer on the Google I/O 2014 app. Google I/O is an annual conference that Google holds for developers.

Follow official Android Development channels on social media

Aside from the blog, you can get the latest news about Android development via:

Kirill’s Favorite Resources

In addition to the official channels for Android development news, there’s a ton of content online, and a vibrant ecosystem of Android developers who are happy to share their knowledge through blog post articles, social media tips, and conference talks.

Here are some of Kirill’s favorite Android resources:

  • Styling Android blog: A blog that shows off various technical aspects of building design elements of Android apps.
  • Chris Banes’ blog: A blog that gives you a deeper look into Android support libraries.
  • Fragmented Podcast: A weekly podcast filled with Android development discussion.

You can find Kirill on G+, and check out his #pixelpushing series.

Visual Studio 2017 JQuery, WebPack and .Core

http://leruplund.dk/2017/04/15/setting-up-asp-net-core-in-visual-studio-2017-with-npm-webpack-and-typescript-part-i/

 

The CLI moved into a separate package: webpack-cli.
Please install ‘webpack-cli’ in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D

https://github.com/FormidableLabs/webpack-dashboard/issues/97

 

(Make sure you deleted the bundle.js file to ensure your task runner is executing correctly)

If you configure the TASK RUNNER EXPLORER and you do NOT get your files in the DIST FOLDER…
Make sure that Visual Studio is using the global installed version of npm not it’s local.
In VS 2017 TOOLS | OPTIONS
In filter box type: External Web Tools

Move $(PATH) to the top of the list in the Locations of External tool

 

npm install jquery –save

Adding JQuery typings

https://www.npmjs.com/package/@types/jquery

Install d3 via npm then typings

npm install –save d3

npm install –save @types/d3

%d bloggers like this: