Categories
Support

JavaScript Dates

JavaScript gives you a lot of flexibility when it comes to date functionality. You can easily pull out any segment individually with just a simple function call. However if you want to format a date, you’ll either need to use the built-in format function, or do a long string concatenation which makes your code look messy.

In my spare time, I made a Server Side JavaScript function for Classic ASP. The source and an example is posted on my personal blog. This function allows you to format dates similar to how PHP’s Date function works. I decided it would be amazing if I could just go ahead and tweak this to work with JavaScript on the client side, so I went ahead and modified my current script to extend the JavaScript date object. Here is a quick peak at how to use this.

console.log(new Date(2012, 1, 25, 10).formatDate('Y-m-d H:i:s'));
// 2012-02-25 10:00:00
console.log(new Date().formatDate('l, F jS, Y'));
// Monday, February 27th, 2012
console.log(new Date().formatDate('r'));
// Mon, 27 Feb 2012 14:03:40 -0600 

Download formatDate.js

(Source: Skynet Solutions)

By Blaine Schmeisser

Categories
Support

Windows Compatibility

Recently, while trying to make a Win95 program run correctly in Windows 7, the UAC (User Account Control) was giving me problems. After searching high and low for a solution, I finally found this on the Microsoft Website. Here’s a little text from the page about this software. The Microsoft Application Compatibility Toolkit (ACT) version 5.6 contains the necessary tools and documentation to evaluate and mitigate application compatibility issues before deploying Windows 7, Windows Vista, a Windows Update, or a new version of Windows Internet Explorer in your environment. I was really impressed with the size and ease of use.

(Source: Skynet Solutions)

By Tony Purkey

Categories
Support

Should you worry about Non-JavaScript Users?

This is a very common question, and the answer varies upon what you are doing. For instance, what is the site’s intention? Who is your target audience? How far can a user without JavaScript get into your website? These are a few of the questions you should consider before building a website.

Less than 2% of users disable JavaScript or don’t have support. This number is rather low, but does that mean they aren’t worth considering? I’ll try and put that into perspective. Let’s assume you have an eCommerce website and sell $10,000/month of product. If you decide to make users have JavaScript in order to check out, you could be losing $200/month or $2,400/year!

I’m not saying you should always make your website plain and boring with no fade in effects or fancy JavaScript rollovers, because users love things like that. However, crucial parts like registering for the website, checking out, emailing support, and other crucial items should all still work without JavaScript.

Yes, you can still make the contact box fade in when they click “contact,” but make sure there is a fallback for users without JavaScript, so they can still contact you. This is easy to accomplish by making the default link go to the real contact page, but use JavaScript to attach a click event to the link. You can still have fancy JavaScript form validation, but make sure you validate on the server and display appropriate error messages as well.

(Source: Skynet Solutions)

By Blaine Schmeisser

Categories
Support

Cannot Update Android Market App

So I clicked on the Android Market icon on my Samsung Galaxy Tab 8.9 only to see Client is out of date, an update will download shortly.

I clicked OK and waited for this magic update. Unfortunately, nothing happened. So I went and consulted the almighty Google, only to find outdated posts and similar issues from back in 2010.

I did confirm there was a recent Android Market update on January 25th 2012. I found out that my tablet that was brand new in November of 2011 shipped with version 1.0.28!!

I emailed Google and have yet to get a response. I started searching for Android Market APK and found tons of links to MultiUpload.com. Unfortunately, they have been shut down due to the wonderful new version of Internet Censorship.

Good news though; I did find a semi-recent version of the APK here:

http://www.androidpolice.com/2011/11/19/download-updated-android-market-v3-3-12/

This is not the newest version of the Android Market. The most recent version is 3.4.4. I downloaded the above version, and it updated itself after that.

I did hunt down another link that is for version 3.4.4, and it is not hosted by MultiUpload.com or BtJunkie.com. You can download it here:

http://www.droid-life.com/2011/12/14/download-new-android-market-version-3-4-4/

(Source: Skynet Solutions)

By Jed Parmenter

Categories
Support

“getS” Code Snippet

Formatting dates is something everybody likes to do, and everybody has their favorite way of formatting it. ASP has a few built in functions to enable us to output it in almost any format we like. However, something I’ve always wanted from Classic ASP was the ability to get the day suffix. Such as turning ‘January 1, 2012’ to ‘January 1st, 2012’. It’s easier to read and looks a lot nicer. Classic ASP has no support for this so here is a small snippet giving an example of how this can be accomplished and a few examples.

Example (pastebin):

<% currDate = NOW() Response.write("Today is the " & DAY(currDate) & getS(DAY(currDate)) & "<br />") ' Today is the 11th  '  currDate = DateAdd("d", 1, currDate)  Response.write("Tomorrow is the " & DAY(currDate) & getS(DAY(currDate)) & "<br />")  ' Tomorrow is the 12th %>

Source (pastebin):

<% '' ' A basic copy of PHP's version of date('S') ' "English ordinal suffix for the day of the month, 2 characters" ' @param int day The day suffix you are looking for. ' @return st ring This is the suffix you were looking for. '' Function getS(fn_day)  If fn_day = "" Then fn_day = CStr(DAY(NOW()))  Else fn_day = CStr(CInt(fn_day)) End If  fnll = Mid(fn_day, len(fn_day), 1) If len(fn_day) = 1 Then fndl = -1  Else fndl = Mid(fn_day, len(fn_day)-1, 2)  End If  If fndl >= 11 AND fndl <= 13 Then  getS = "th"  Exit Function  ElseIf fnll = 1 Then  getS = "st"  Exit Function  ElseIf fnll = 2 Then  getS = "nd"  Exit Function  ElseIf fnll = 3 Then  getS = "rd"  Exit Function  Else  getS = "th"  Exit Function  End If End Function %>

(Source: Skynet Solutions)

By Blaine Schmeisser

Categories
Support

Estimating I/S Projects

Giving time estimates for programming projects can be a very tricky process. Many times when a project comes in late, it can be traced back to a bad time estimate given up front. For small projects where a task is quickly explained to you, and you are then asked to give a ball-park figure, you might not have time to take into consideration all of the aspects that have to be handled. Although you do know the bigger details involved and can make a reasonable guess. The problem comes in when there are three or four other small items you didn’t think about, and these end up having to be handled in the same time frame.

Another problem can be in the testing. A lot of developers do not realize the amount of time they have to spend testing their programs. Depending upon the project, a developer may need to spend as much time testing a program as they spent writing it. Testing as many scenarios as possible can be very time consuming, but it makes a big difference in your end product.

Generally, on a small task or project I’m doing, I will determine how long I believe it will take me and then multiply that by 2 or 2-½. The 2 or 2-½ depends upon how much testing will be required and how familiar I am with the system. Over the years, experience has convinced me that I’m only about half as quick as I think I am. In order to determine a good ratio for yourself, estimate jobs with how long you think they will take, and then note actual times. You can compare estimates to actual time. Then you will have a good number to adjust your future estimates by.

On larger projects consisting of multiple tasks or developers, it is important to break the project down into individual tasks and attack them separately. You should try and define every possible task, describe it fully, and then determine how long it will take. It can take hours or days to create good estimates on some projects. However, the process of creating an accurate estimate can also produce detailed task lists and program specifications that can be used when the project begins. A good time estimate allows for creating deadlines that are reachable. It also makes for a project that doesn’t have you working nights and weekends under intense pressure to get the job completed on time.

(Source: Skynet Solutions)

By DJ Burrup