Is there a natural language parser for date/times in javascript?
SugarJS supports some natural language parsing of dates and times.
You can jump to the live example here: http://sugarjs.com/dates
For example, it supports the following inputs:
You can then covert the result into different date formats or use the API to further manipulate the date.
I've developed a small library called chrono for parsing date in Javascript too. I also add date range parsing feature (such as '12 Nov - 13 Dec 2012')
You can check in here.
Does Date.js satisfy your needs? Or are you looking for something else?
For node, I've found chrono to work well
Chrono supports most date and time formats, such as :
You can use the jQuery datepicker translation, get the day and month number and select the day from datepicker days.
You can add values to this object, and you can download up to 60 languages I think. (The object below is not complete, I removed some code to simplify it).
$.datepicker.regional['sv'] = {
monthNames:['Januari','Februari','Mars','April','Maj','Juni','Juli','Augusti','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],
dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö']
};
Now get the day and month number
var dateObject = new Date();
var day = dateObject.getDay();
var month = dateObject.getMonth();
var monthText = $.datepicker.regional['sv']['monthNames'][month];
var dayText = $.datepicker.regional['sv']['dayNames'][day];
Date
object - bfontaine 2014-08-04 11:46
http://stackoverflow.com/questions/1003330/is-there-a-natural-language-parser-for-date-times-in-coldfusion
Why not just say javascript or Cold Fusion - samoz 2009-06-16 19:02