Returns the element that has the ID attribute with specified value. Takes in one argument that corresponds to the name of the ID.
Returns the first element that matches a specified ID, class name or tag name. Takes in one argument that corresponds to the name of the ID, class or tag.
Returns all elements that matches a specified ID, class or tag name. Takes in one argument that corresponds to the name of the ID, class or tag.
lr.convertDateAdvanced is an important and useful function as most date functions in JavaScript and other
date libraries, including this one, expects a valid date string or date object as an argument.
lr.convertDateAdvanced can convert any date format to a valid date object or string. It takes in three
arguments, first one is the format of the date you are passing on, second is the date and third is whether
you want a date string or object.
If you would like a date object, pass a string "short" as the
third argument, like in the third example below.
yy (required) - Full year. Eg: 2018
mm (required) - Full Month name, half month name or month number. Eg: January, Sep or 7
dd (required) - Date number. Eg: 3
hh (optional*) - Hour number. Eg: 13, 3
min (optional) - Minute number. Eg: 25
ss (optional) - Second number. Eg: 5
*Hours is optional; however, it is required if min is mentioned in the format.
Note: Formatting keys are case sensitive and shouldn't have a letter or word attached to it. Eg: ddday for 15day is invalid.lr.convertDate is a simplified version of lr.convertDateAdvanced.
Formatting keys can have only one separator eg: - , @ etc.
It takes in three arguments, first one
is the format of the date your passing on, second is the date and third is whether you want a date string or
object.
If you would like a date object, pass a string "short" as the third argument, like in the
first example below.
If you would like to add time, pass it in with second argument and put a
space between date and time, the time should be on the right hand side, no need to mention it in the first
argument
yy (required) - Full year. Eg: 2018
mm (required) - Full month name, half month name or month number. Eg: January, Sep or 7
dd (required) - Date number. Eg: 3
Note: Formatting keys are case sensitive and shouldn't have a letter or word attached to it. Eg: ddday for 15day is invalid.Get a date in any format you like, essentially the opposite of lr.convertDateAdvanced. It takes in two arguments, first the format you would like the date to be in and second which is optional, a specific date that needs to be a valid date string or object.
yy- Full year. Eg: 2018
mm- Month number. Eg: 12
fm- Full month name. Eg: February
sm- Short month name. Eg: May
dd- Day number. Eg: 5
dn- Day name. Eg: Tuesday
dsn- Short day name. Eg: Fri
hh- Hour number. Eg: 13
min- Minute number. Eg: 56
ss- Second number. Eg: 12
Get date and time of any time zone. The function takes one argument, which is the time zone ID of the time offset.
If you would like to know time zone ID / time offset check out the link here
If you know the time offset or want to know the time zone ID of any device use lr.getCC
Convert time from one country's / time zone's to another country's / time zone's time. The function takes in three arguments, first one is the initial time zone ID, second is the time zone ID you want to convert to, third is the date and time that needs to be a valid date string or object.
Get date and time of any time zone. The function takes one argument, which is the time zone ID of the time offset.
Adds specified parameters to date. The function takes two arguments, first is by how much you want to move the date forward to, second is the date, second argument is optional. If a second argument is not provided it will use current date.
Days- Eg: 5 Days or 1 Day
Months-Eg: 2 Months
Years- Eg: 4 Years
Name of day- Eg: Wednesday
Hours- Eg: 5 Hours
Minutes-Eg: 2 Minutes
Seconds- Eg: 4 Seconds
Subtracts specified parameters to date. The function takes two arguments, first is by how much you want to move the date back to, second is the date, second argument is optional. If a second argument is not provided it will use current date.
Days- Eg: 5 Days or 1 Day
Months-Eg: 2 Months
Years- Eg: 4 Years
Name of day- Eg: Wednesday
Hours- Eg: 5 Hours
Minutes-Eg: 2 Minutes
Seconds- Eg: 4 Seconds
Finds difference between two dates (Leap Year Included). The functions takes three parameters, first the date you want in the L.H.S, second the date you want in the R.H.S, third argument is if you want time too.
Pass string "long" in the third parameter if you want hours, minutes and seconds
Replace every occurrence of a word in a string specified in the first argument with the word passed in the second argument.
Capitalizes every word in string.
Turns kebab case to camel case.
Checks if string contains argument that is passed on. It also takes a second argument which is a boolean to indicate case sensitivity.
Counts number of occurrences of a word in a string.
Replace keys in a string for words.
Shortens string to number of characters mentioned in the first argument and replaces it with characters in the second argument
Loops for each character
Loops for each word
Searches for a letter in a string and returns its position
Checks if array contains a specific value and gives its position. It also takes a second argument which is a boolean to indicate case sensitivity.
Returns index of max value in an array.
Returns index of min value in an array.
Returns value of biggest value in an array.
Returns value of smallest value in an array.
Lower cases all values in an array.
Upper cases all values in an array.
Returns a random string of character. The function takes in two arguments, the first one indicates how many characters you want and the second one takes the type of string you want.
alphanum- For alphanumeric string
string- For string with only alphabets
*Leave second argument as blank to get a string with only numbers
Gets absolute url and adds passed argument.
Gets arguments from URL, follow format below.