Author Archives: sourcecodemart

Moto G XT1550 (Gen 3) Receiving Android 6.0 Marshmallow Update in India

After US and Canada, Motorola India last week started roll-out  an Android 6.0 Marshmallow update for the Moto G (Gen 3) in India. The Indian Moto G3 is now receiving the Marshmallow update over-the-air (OTA). The company confirmed in a tweet.

It may take some time to reach all users. The Moto G3 users manually can check for update: Settings >> About Phone >> System Update.

Moto G3 Marsh Mallow

Moto G3 Marsh Mallow

jQuery Datepicker: Allow to type date

We often used jQuery datepicker to show calendar while inputting date into field. It helps to user to select particular date in correct format and easy to enter. Normally, ones we assigned jQuery datepicker object to DOM it converts that DOM to readonly so there was less chance of mistake.

How you can assign jQuery datepicker to DOM?

jQuery(‘.pickdate’).datepicker();

Click here to play with datepicker object.

As I mention above datepicker object convert DOM to readonly so how you can make it self writeable. Here is.

jQuery(‘.datepick’).datepicker().prop({‘readonly’: false});

There is no rocket science to do this. I just assign readonly property to false. Now the DOM is allowing you to write.

Change administrator on Google Analytics

analytics

Google analytics is used for analysis of your site’s traffic data. So you can concentrate on your goal of site. It’s very good product as it gives so many different kind of reports and one most and important thing is -> It’s FREE.

As per mention title here we will see how to change administrator of Google analytics? i.e. How to change ownership of Google analytics account.

Why does it need to change ownership?

There are several reason behind that why does it need to change ownership. As per my knowledge I mention below.

1. You have hired SEO Specialist and they are using their account for your site analytics.
2. You are the SEO Expert and want to give ownership of your customer.
3. You have changed your email address.
4. You want to take all other Google account under same email address. Such as gmail, drive, adsense, analytics, calender, etc.
5. and many more as per situation.

It’s very simple to change ownership of Google Analytics. It may take only 10 mins. so let’s get started.

Logged into Google Analytics account and go into the Admin link.

  • Select specific account to change ownership.
  • Click on “User Management” link.

Google analytics 1

Give Permission:

  • Add email account where you want to give ownership.
  • Select all check boxes to make entered user to super user (Administrator).
  • Lastly, click on “Add” button.
  • Then you can see entered user added in link. Please loggin with newly entered user and just confirm.

Google Analytics 2

Remove user:

  • It does not require to delete user but you can delete if you really don’t want older one.
  • And it is DONE. :)

Google Analytics 3

You have done. Its very simple process to change ownership. If you like that then please share it.

 

 

jQuery datepicker: Disabled previous/next/any days

We have seen how to customize jquery datepicker in different condition. such as,

jQuery calender: Highlight date with different color
jQuery datepicker: change position of month and year drop down
jQuery Calender: Manage Year Range
jQuery Calender: Include month and year dropdown
jQuery Datepicker

Here today I am going to explain how to disabled previous days, next days or disabled any week days. As I mentioned jQuery datepicker is highly customize so that you just need to pass parameter to disabled previous and next day. In order to disabled any week day you need to write condition on beforeshowday function. Let’s see one by one.

How to disabled previous days or you can say passed days?

jQuery(‘div’).datepicker({‘minDate’ : 0});

output:

jQuery-datepicker-min-date-disabled

 

How to disabled next days or you can say future days?

jQuery(‘div.maxdate’).datepicker({‘maxDate’ : 0});

output:

jQuery-datepicker-max-date-disabled

How to disabled any week days? disabled saturday and sunday.

jQuery(‘div.anydate’).datepicker({
beforeShowDay : function(date){
if(date.getDay() == 0 || date.getDay() == 6){
return [false];
}else{
return [true];
}
}
});

output:

jQuery-datepicker-any-date-disabled

A full example:

Full form of computer terms

HTTP Hyper Text Transfer Protocol
HTTPS Hyper Text Transfer Protocol Secure
IP Internet Protocol
URL Uniform Resource Locator
USB Universal Serial Bus
VIRUS Vital Information Resource Under Seized
3G 3rd Generation
GSM Global System for Mobile Communication
CDMA Code Divison Multiple Access
UMTS Universal Mobile Telecommunication System
SIM Subscriber Identity Module
AVI Audio Video Interleave
RTS Real Time Streaming
SIS Symbian OS Installer File
AMR Adaptive Multi-Rate Codec
JAD Java Application Descriptor
JAR Java Archive
JAD Java Application Descriptor
3GPP 3rd Generation Partnership Project
3GP 3rd Generation Project
MP3 MPEG player lll
MP4 MPEG-4 video file
AAC Advanced Audio Coding
GIF Graphic InterchangeableFormat
JPEG Joint Photographic ExpertGroup
BMP Bitmap
SWF Shock Wave Flash
WMV Windows Media Video
WMA Windows Media Audio
WAV Waveform Audio
PNG Portable Network Graphics
DOC Document (Microsoft Corporation)
PDF Portable Document Format
M3G Mobile 3D Graphics
M4A MPEG-4 Audio File
NTH Nokia Theme (series 40)
THM Themes (Sony Ericsson)
MMF Synthetic Music Mobile Application File
NRT Nokia Ringtone
XMF Extensible Music File
WBMP Wireless Bitmap Image
DVX DivX Video
HTML Hyper Text Markup Language
WML Wireless Markup Language
CD Compact Disk
DVD Digital Versatile Disk
CRT Cathode Ray Tube
DAT Digital Audio Tape
DOS Disk Operating System
GUI Graphical User Interface
HTTP Hyper Text Transfer Protocol
IP Internet Protocol
ISP Internet Service Provider
TCP Transmission Control Protocol
UPS UninterruptiblePower Supply
HSDPA High Speed Downlink Packet Access
EDGE Enhanced Data Rate for GSM [Global System for Mobile Communication] Evolution
VHF Very High Frequency
UHF Ultra High Frequency
GPRS General Packet Radio Service
WAP Wireless Application Protocol
TCP Transmission Control Protocol
ARPANET Advanced Research Project Agency Network
IBM International Business Management
HP Hewlett Packard
AM/FM Amplitude/ Frequency Modulation
WLAN Wireless Local Area Network

Source code from Tech Word of the Day

HTML5 Placeholder styling

I want to share css trick to change palceholder color. In this era HTML5 and CSS3 combination make developer life easier. Here you can see how to make place holder stylish.

How to define Placeholder?

It pretty simple. It’s a attributes of DOM element same like others.

<input type=”text” name=”firstname” placeholder=”Enter your first name” />

html5-placeholder-without-style

 

Default Placeholder has light gray color. Now just think how if it has some other color or match with your design. :)

For styling placeholder you just need to play with css. copy and paste below code in your page and see what happen.

<style>
::-webkit-input-placeholder {color:green;} /* webkit browser */
::-moz-placeholder {color:green;} /* mozilla firefox */
:-ms-input-placeholder {color:red;} /* ie */
</style>
<input type=”text” name=”firstname” placeholder=”Enter your first name” />

html5-placeholder-style

A full example:

 

jQuery calender: Highlight date with different color

Today I have done experiment to highlight specific date with different color in datepicker. Let’s see step by step.

jQuery-datepicker-hightlight-color

CSS: overright css class with differ color. Here I have applied red background color with white font. You can change its with your choice of code.

.ui-highlight .ui-state-default{
background: red !important;
border-color: red !important;
color: white !important;
}

Make a array of dates that you want to highlight.

var dates = [‘2014-01-05′,’2014-01-15′,’2014-01-25’];

Put some logic to match date and apply your css class. Here I have made a custom date in YYYY-MM-DD format as it same as a array value and easy to find out into the array.

beforeShowDay : function(date){
var y = date.getFullYear().toString(); // get full year
var m = (date.getMonth() + 1).toString(); // get month.
var d = date.getDate().toString(); // get Day
if(m.length == 1){ m = ‘0’ + m; } // append zero(0) if single digit
if(d.length == 1){ d = ‘0’ + d; } // append zero(0) if single digit
var currDate = y+’-‘+m+’-‘+d;
if(dates.indexOf(currDate) >= 0){
return [true, “ui-highlight”];
}else{
return [true];
}
}

That’s it. You have done. :)

A full example: just copy and paste into your test page and see how it works.

jQuery datepicker: change position of month and year drop down

As we have seen how to add month and year drop down and how to customize year drop down range. Here I am going to explain how to switch position of month and year drop down. Usually, you can see in jQuery datepicker month and year drop down respectively but sometime you need to change position of both like first year then month. It is pretty simple. You just need to pass one more parameter.

showMonthAfterYear : true

jQuery Calender - 2

jQuery(‘div’).datepicker({
changeMonth : true,
changeYear  : true,
showMonthAfterYear : true // you are looking for
})

A complete example.

jQuery Calender: Manage Year Range

calender-month-year

If you are building high interactive web application and want to add calender then jQuery UI is perfect pick for you. jQuery UI gives so many customizable things in calender. As we have seen how to add month and year in calender in previous article. It has +10 year range in jQuery datepicker but you can give cusomizable year range as per your requirement. It’s also pretty simple. You just need to add yearRange:”-10:+10″.

yearRange:”-10:+10″

See you can write any year [1990] instead of -10 or also can give -15,-20,… and same as for +10 i.e for bottom year.

There are some sample code:

yearRange:”-20:2015″
yearRange:”1990:+20″
yearRange:”-20:+20″
yearRange:”1990:2015″

jQuery(‘div’).datepicker({
        changeMonth:true,
        changeYear:true,
        yearRange:”-20:2015″
      });

A full example code:

jQuery Calender: Include month and year dropdown

As you have seen how to add a simple jQuery calender in your project, Now think about enhancement. A jQuery Calender have much more predefined function. Here I am going to explain how to add month and year drop down in jQuery Calender so user can move one to another month or year directly instead of next/previous button.

calender-month-year

It’s pretty simple to add month or year in a calender. You just need to pass parameter for showing month and year drop down.

jQuery(‘.calender’).datepicker({
changeMonth : true,
chanagYear : true
})

If you want to show only month then add only changeMonth:true and vice versa.

A full example code: