Category Archives: Web

Mocking Time with sinon.js

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.

I was writing some tests for an Angular app and ran into a scenario where I needed a page to behave differently if the time of day was before or after 6AM.  The logic is simple enough to capture in my controller:

[code language="javascript" collapse="false"]
vm.date = moment().subtract(6, 'hours').toDate();
[/code]

Basically, if it is before 6AM, display the prior day, otherwise display today. However, as I was trying to write a test for this controller the problem came up: how do I take control of the current time to test both scenarios?

Read more

SP.UI.ModalDialog.showModalDialog

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.


I was trying to implement a modal popup for a web control and ran in to a few snags. So here I am with a few hints on how to use the SharePoint JavaScript modal dialog control.

Read more

Why is jQuery call ‘getJSON()’ returning cached data?

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.

Just wanted to make a quick post about something that was annoying me today and I learned how to fix it.

I am working on an ASP.NET MVC application making use of the jQuery.getJSON() method to retrieve data from an MVC Controller and displaying it on my web page.  I found that the jQuery.getJSON() call was caching the data and not actually calling my MVC Controller method each time that JavaScript called the method.

Read more

« Older Entries Recent Entries »