Posts

Showing posts with the label angularjs

BGTS LDAP Authentication Module

Image
A simple LDAP authentication module for Laravel using Caffeinated Module and Angular JS Checks if a username is registered in an LDAP collection. Replaces the default Laravel Authentication.    

Microsoft Excel's Networkdays on Javascript

Here is a small snippet I made to do Networkdays function of MS Excel in Javascript. networkdays = function (startDate,endDate){ var startDate = typeof startDate=='object' ? startDate: new Date (startDate); var endDate = typeof endDate=='object' ? endDate: new Date (endDate); if (endDate > startDate){ var days = Math .ceil((endDate.setHours(23,59,59,999) - startDate.setHours(0,0,0,1)) / (86400 * 1000)); var weeks = Math .floor( Math .ceil((endDate.setHours(23,59,59,999) - startDate.setHours(0,0,0,1)) / (86400 * 1000)) / 7); days = days - (weeks * 2); days = startDate.getDay() - endDate.getDay() > 1 ? days - 2 : days; days = startDate.getDay() == 0 && endDate.getDay() != 6 ? days - 1 : days; days = endDate.getDay() == 6 && startDate.getDay() != 0 ? days - 1 : days; return days; } return null ; }; Usage: networkdays('08/05/2016','08/30/2016'); OR networkdays(new Date(), '08/30/2016'); Acce

Make Laravel 5 Modular Part 1

Image
My current company is heading towards the Laravel and Angular JS path on creating tools for the departments. We were assigned to learn Laravel and Angular JS on our own as soon as possible. Since I saw that the company's data is getting bigger and bigger as time goes by, I researched for a way for us, the developers, to be able to create applications faster and make it much easier to maintain. We all know that making a modular application is currently the best approach on large projects.