patmap Posted July 22, 2011 Share Posted July 22, 2011 Hi Mr. Farshad I'm sory for meny request. Can you add Jalali Calendar in uniGUI ? This calendar very needed for persians. Very Thanks. https://github.com/Behrang/Ext.ux.JalaliDatePlugin Best Regars Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 22, 2011 Administrators Share Posted July 22, 2011 Ex: https://github.com/Behrang/Ext.ux.JalaliDatePlugin I don't see anything related to Calendar in above link. Quote Link to comment Share on other sites More sharing options...
patmap Posted July 22, 2011 Author Share Posted July 22, 2011 I don't see anything related to Calendar in above link. Then address name is correct but link changed !!! The correct link: Jalali Calendar Best Regards Quote Link to comment Share on other sites More sharing options...
patmap Posted July 23, 2011 Author Share Posted July 23, 2011 Hi, Mr. Farshad Can you add this future please ? The correct link: Jalali Calendar Best Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 23, 2011 Administrators Share Posted July 23, 2011 OK I will look at it. We will not implement this as a new component. I will try to show you how to integrate it into your application. Quote Link to comment Share on other sites More sharing options...
patmap Posted July 23, 2011 Author Share Posted July 23, 2011 OK I will look at it. We will not implement this as a new component. I will try to show you how to integrate it into your application. Very thanks Mr. Farshad. Best Regards Quote Link to comment Share on other sites More sharing options...
patmap Posted August 7, 2011 Author Share Posted August 7, 2011 OK I will look at it. We will not implement this as a new component. I will try to show you how to integrate it into your application. Hi Mr. Farshad Can you make a sample for this pluging? Or how can i use this plugin in my project ? Best Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 8, 2011 Administrators Share Posted August 8, 2011 To MainForm.Scrpits add: Ext.override(Ext.DatePicker, { initComponent: Ext.DatePicker.prototype.initComponent.createInterceptor(function() { this.plugins = [Ext.ux.JalaliDatePlugin]; return(true); }) }); To ServerModule.CustomFiles add files\Jalali\Jalali.js files\Jalali\JalaliDate.js files\Jalali\JalaliDatePlugin.js files\Jalali\JalaliDatePlugin-fa_IR.js This will change all DatePicker instances in your app to jalali calendar. Quote Link to comment Share on other sites More sharing options...
patmap Posted August 8, 2011 Author Share Posted August 8, 2011 To MainForm.Scrpits add: Ext.override(Ext.DatePicker, { initComponent: Ext.DatePicker.prototype.initComponent.createInterceptor(function() { this.plugins = [Ext.ux.JalaliDatePlugin]; return(true); }) }); To ServerModule.CustomFiles add files\Jalali\Jalali.js files\Jalali\JalaliDate.js files\Jalali\JalaliDatePlugin.js files\Jalali\JalaliDatePlugin-fa_IR.js This will change all DatePicker instances in your app to jalali calendar. Hi, Mr. Farshad Thank you for your reply. This work very good and DateTimePicker show Jalali Calendar Panel. But have a litle problem, in the DatetTimePicker text box not show jalali Date !!! This shown a gregorian date. Event a select a jalali date and close the Jalali Panel in the text box not show Jalali Date !!! Please help me. Thank you and Best Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 8, 2011 Administrators Share Posted August 8, 2011 Not sure what can be done about it. Gregorian date is used internally by both Ext JS and Delphi and this can not be changed. You must convert date when it is displayed but all these must be implemented in JS. i.e. you need a JS code which converts Gregorian date to Persian date. Also date must be converted back to Gregorian when it is sent back to the server. Quote Link to comment Share on other sites More sharing options...
patmap Posted August 8, 2011 Author Share Posted August 8, 2011 Hi, Mr. Farshad I can convert it to display in textbox, but when i click on calnedar button to view Jalali Calendar Panel, i cant triger this and jalali date send to panel and panel convert it to jalali agin and date is incorrect shown in then panel !!! How can i trigger this when panel want get date from textbox i give it a grigorian date ? If we have a OnGetText event like DBEdit or TField only for display a text not for store text in the DateTimePicker this is a best way for do it. Can you help me for this event Please ? Best Regrads Quote Link to comment Share on other sites More sharing options...
patmap Posted August 8, 2011 Author Share Posted August 8, 2011 Hi Mr. Farshad I Solved it with this code on OnAjaxEvent : JSCode('document.getElementById("'+Self.JSName+'_id").value="'+GetJalaliDate+'";'); Thank you Best Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 8, 2011 Administrators Share Posted August 8, 2011 Hi Mr. Farshad I Solved it with this code on OnAjaxEvent : JSCode('document.getElementById("'+Self.JSName+'_id").value="'+GetJalaliDate+'";'); Thank you Best Regards Good. I will analyze your workaround and try to integrate it in framework if possible. 1 Quote Link to comment Share on other sites More sharing options...
patmap Posted August 9, 2011 Author Share Posted August 9, 2011 Hi. Mr. Farshad I develope this component with OnGetText event and work fine ! unit UniXJalaliCalendar; interface uses SysUtils, Classes, Controls, Ext, ExtPascal, ExtCalendar, uniGUIBaseClasses, uniGUIClasses, uniPanel, uniDateTimePicker, DateFunc; Type TDateTimePickerGetText = procedure(sender: TObject; Var DisplayText: AnsiString) Of Object ; Type TUniXJalaliCalendar = class(TUniDateTimePicker) private FVersion: string; OldOnAjaxEvent: TUniAjaxEvent ; FOnGetText: TDateTimePickerGetText; function GetJalaliDate: String; Procedure OnMyAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); { Private declarations } protected { Protected declarations } Procedure Loaded; Override; public { Public declarations } Constructor Create(Owner: TComponent); Override; Destructor Destroy; published { Published declarations } Property JalaliDate: String Read GetJalaliDate ; Property OnGetText: TDateTimePickerGetText Read FOnGetText Write FOnGetText ; End; procedure Register; Implementation // ----------------------------------------------------------------------------- Procedure Register; Begin RegisterComponents('uniGUI Custom', [TUniXJalaliCalendar]); End ; // ----------------------------------------------------------------------------- { TUniXJalaliCalendar } Constructor TUniXJalaliCalendar.Create(Owner: TComponent); Begin Inherited Create(Owner); End ; // ----------------------------------------------------------------------------- destructor TUniXJalaliCalendar.Destroy; begin inherited; End; // ----------------------------------------------------------------------------- Function TUniXJalaliCalendar.GetJalaliDate: String; Begin DateTimeToString(Result, 'yyyy/MM/dd', Self.DateTime) ; Result := StrMToSh( Result ) ; End; // ----------------------------------------------------------------------------- Procedure TUniXJalaliCalendar.Loaded ; Begin Inherited; If WebMode Then Begin OldOnAjaxEvent := Self.OnAjaxEvent ; Self.OnAjaxEvent := OnMyAjaxEvent ; Self.Text := '' ; End; End; // ----------------------------------------------------------------------------- Procedure TUniXJalaliCalendar.OnMyAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); Var DisplayText : AnsiString ; Begin If SameText(EventName, 'select') And ( Params.Values['Date'] <> '' ) Then Begin If Assigned(FOnGetText) Then FOnGetText(Sender, DisplayText) Else DisplayText := GetJalaliDate ; JSCode('document.getElementById("'+Self.JSName+'_id").value="'+DisplayText+'";'); End; If Assigned(OldOnAjaxEvent) Then OldOnAjaxEvent(Sender, EventName, Params); End ; // ----------------------------------------------------------------------------- End. This code in AjaxEvent very important condition: Params.Values['Date'] <> '' Best Regrads Quote Link to comment Share on other sites More sharing options...
richard_wu Posted August 9, 2011 Share Posted August 9, 2011 not DateFunc unit Quote Link to comment Share on other sites More sharing options...
patmap Posted August 9, 2011 Author Share Posted August 9, 2011 not DateFunc unit Hi Jalali DateFunc Added. Best Regards DateFunc.zip Quote Link to comment Share on other sites More sharing options...
valadi Posted January 17, 2016 Share Posted January 17, 2016 To MainForm.Scrpits add: Ext.override(Ext.DatePicker, { initComponent: Ext.DatePicker.prototype.initComponent.createInterceptor(function() { this.plugins = [Ext.ux.JalaliDatePlugin]; return(true); }) }); To ServerModule.CustomFiles add files\Jalali\Jalali.js files\Jalali\JalaliDate.js files\Jalali\JalaliDatePlugin.js files\Jalali\JalaliDatePlugin-fa_IR.js This will change all DatePicker instances in your app to jalali calendar. not work loop loading .... plz make sample code Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2016 Share Posted January 18, 2016 Hi, 1. Download these files and copy to directory for example "files/": https://raw.githubusercontent.com/behrang/Ext.ux.JalaliDatePlugin/master/Jalali.js https://raw.githubusercontent.com/behrang/Ext.ux.JalaliDatePlugin/master/JalaliDate.js https://raw.githubusercontent.com/behrang/Ext.ux.JalaliDatePlugin/master/JalaliDatePlugin-fa_IR.js https://raw.githubusercontent.com/behrang/Ext.ux.JalaliDatePlugin/master/JalaliDatePlugin.js * JalaliDatePlugin-fa_IR.js - for localization 2. UniServerModule.CustomFiles add these "lines": files/Jalali.js files/JalaliDate.js files/JalaliDatePlugin.js files/JalaliDatePlugin-fa_IR.js 3. UniDateTimePicker->ClientEvents->UniEvents ... add beforeInit fn: function beforeInit(sender, config) { sender.plugins = [new Ext.ux.JalaliDatePlugin] } Try... Best regards. Quote Link to comment Share on other sites More sharing options...
valadi Posted January 18, 2016 Share Posted January 18, 2016 Thanks Delphi Developer Can do add all Datepicker Renderers in unigui There are many different calendars used throughout the world. This plugin aims to make them accessible in JavaScript in a consistent manner. The basic modules provide the underlying calendar support, while the picker module builds a generic datepicker on top of this functionality. Quote Link to comment Share on other sites More sharing options...
valadi Posted January 19, 2016 Share Posted January 19, 2016 Can do add all Datepicker Renderers in unigui There are many different calendars used throughout the world. This plugin aims to make them accessible in JavaScript in a consistent manner. The basic modules provide the underlying calendar support, while the picker module builds a generic datepicker on top of this functionality. Quote Link to comment Share on other sites More sharing options...
molla2005b Posted June 30, 2016 Share Posted June 30, 2016 Thanks Delphi Developer It is not work when UniDateTimePicker1.Kind=tUniDateTime; but work when UniDateTimePicker1.Kind=tUniDate; 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 30, 2016 Share Posted June 30, 2016 Hi, We will try to analyze it.. Best regards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 1, 2016 Share Posted July 1, 2016 Hi, It is works, but Follow this sequence: 1. UniDateTimePicker1->Kind = tUniDateTime 2. After, UniDateTimePicker1->ClientEvents->UniEvents [Ext.form.field.Date[date]] ... date.beforeInit fn: function date.beforeInit(sender, config) { sender.plugins = [new Ext.ux.JalaliDatePlugin] } Best regards. 1 Quote Link to comment Share on other sites More sharing options...
molla2005b Posted July 23, 2016 Share Posted July 23, 2016 hi ,I'm sorry for many request I have another problem when run this code " edDate2.DateTime:=edDate2.DateTime+1; " jump to more than 15 day after first click case attached too Best regards. Jalalicalender.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 24, 2016 Share Posted July 24, 2016 Hi,Pls can you attach here ?! Best regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.