Tag Archives: snippet

Find Start of a Month for Given Date

Finds Start of the month with given date CREATE FUNCTION [dbo].[StartOfMonth] ( @date datetime ) RETURNS datetime AS BEGIN return DATEADD(M,-1,DATEADD(mm, DATEDIFF(m,0,@date)+1,0)) END

Posted in Uncategorized | Tagged , , , | 2 Comments

End of Month for Given Date

Finds end of the month with given date Create FUNCTION [dbo].[EndOfMonth] ( @date datetime ) RETURNS datetime AS BEGIN return DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@date)+1,0)) END

Posted in Uncategorized | Tagged , , , | Leave a comment

End of a Year for Given Date

Function to find latest second of the year for the given date Create FUNCTION [dbo].[EndOfYear] ( @DATE DATETIME ) RETURNS DATETIME AS BEGIN RETURN DATEADD(s, -1, DATEADD(yy, DATEDIFF(yy,0,@DATE)+1,0) ) END

Posted in Uncategorized | Tagged , , , | Leave a comment

How to hide tabs in tabbed window

What I have been talking about the past few days can be seen on the screen-shots: One of the screens has “Internal” option selected and loads less details requested. The other screen-shot shows “External” option and with loads more fields … Continue reading

Posted in Uncategorized | Tagged , , , | 5 Comments

Convert HR.Net date to JS-format

Convert HRNET string with date into JS date format function getLocalizedDate(sDateStr) { var oDate = new Date(); //Parse the date according to your string var oDateARR = sDateStr.split(“/”); oDate.setDate(oDateARR[0]); oDate.setMonth(oDateARR[1]-1,oDateARR[0]); oDate.setFullYear(oDateARR[2]); return oDate; }

Posted in Uncategorized | Tagged , , , | Leave a comment

Hide data grid in Custom Script

Standard HR.Net Java Script tools does not allow to hide data grids, but this is sometimes required. Here is a JS function to hide data grids. function hideDataGrid(gridName){ var grid = document.getElementById(name); var openButton = document.getElementById(name+”Grid_ImgOpen”); var insertButton = document.getElementById(name+”Grid_ImgInsert”); … Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment

Java Script to hide groups of fields

With version 3 of HR.Net (Yes, I know, there is version 4 out ages ago) Vizual gave ability to insert JavaScript into Screens and Workflows. And I have been using this ability rather a lot on screen. Very often you … Continue reading

Posted in Uncategorized | Tagged , , , , | 1 Comment