Re: Changing current date format
Re: Changing current date format
- Subject: Re: Changing current date format
- From: Shane Stanley <email@hidden>
- Date: Tue, 21 Jan 2014 09:14:20 +1100
On 21 Jan 2014, at 7:42 am, Christopher Stone <email@hidden> wrote:
So rather than hardcode the localization string, it would appear that you could feed it to the hander as part of the call - and it would do the right thing. Yes?
Sure. You could do something like:
on formatDate:theDate usingFormat:formatString andLocale:localeID if class of theDate is date then set theDate to my makeNSDateFrom:theDate set theFormatter to current application's NSDateFormatter's new() if localeID is not missing value then theFormatter's setLocale:(current application's NSLocale's localeWithLocaleIdentifier:localeID) -- set locale end if theFormatter's setDateFormat:formatString set theString to theFormatter's stringFromDate:theDate return theString as text end formatDate:usingFormat:andLocale:
Then change the original to:
on formatDate:theDate usingFormat:formatString return my formatDate:theDate usingFormat:formatString andLocale:(missing value) end formatDate:usingFormat:
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden